How to convert loop code to loopless

for i=0:pi/180:2*pi
x=round(row+radius*cos(i));
y=round(col+radius*sin(i));
if(x>0 && y>0 && x<m && y<n)
A(x,y)=1;
end
end

1 comentario

Stephen23
Stephen23 el 17 de Nov. de 2015
What are the size and class of row, radius, col, m, n, and A?
In order to be able to run your code you need to post a complete working example, not just the part that you think is interesting.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 17 de Nov. de 2015

Comentada:

el 17 de Nov. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by