How Can i speed up "for" loop ?
Mostrar comentarios más antiguos
Hi all,
I have the following code:
for i=1:1:length(y)
for j=1:1:length(x)
if ((X(i,j))^2)/(R_ell^2) + ((Y(i,j))^2)/(r_ell^2) < 1.0
Z(i,j)=0.0;
end
end
end
It takes a lot of time. Can someone help me t speed up these loops?
Thank you
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing 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!