I want to apply what the norm function does, without using norm.
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!