I want to apply what the norm function does, without using norm.
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!