For loop is not working
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Adan91h
el 3 de Mzo. de 2017
Comentada: Adan91h
el 4 de Mzo. de 2017
i"m trying to map values of Y(:,:,k) to specific positions of YT(:,:,alpha) but this code is not working.
for alpha=1:NumberofLines
YT(:,:,alpha) = Y(:,:,k);
alpha= j+1
j=j+j
k=k+1
if (alpha > NumberofLines)
break
end
end
Please help!
0 comentarios
Respuesta aceptada
Image Analyst
el 3 de Mzo. de 2017
Where did you set j? Also, redefining your loop iterator, alpha, inside the loop is not advisable. You can do it, but when it gets to the bottom of the loop, it takes on the value from the "for" line, it does not retain the value you set it to. And why are you setting j equal to j+j?
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!