I want to apply what the norm function does, without using norm.
Show older comments
I am trying to write a code with some overlapping circles. I have written a code that works using the norm function, however, I want as little 'higher-level' functions as possible. Is there a way to do this?
I have the following piece of code that runs:
if norm(center(n,:)-[row col])<= radius
circle_pattern(col,row,n) = 1;
end
And when I replace it with this code (I tried to do some research on norm), my code will not plot the same image.
if ((center(n,:)-row).^2 + (center(n,:)-col).^2) <= radius
circle_pattern(col,row,n) = 1;
end
Any ideas on how to fix this?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!