How to make successive for loops?!
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mariam Sheha
el 1 de Abr. de 2016
Editada: Mariam Sheha
el 8 de Abr. de 2016
Hey everybody;
i want to make 3 successive loops that the next loop start from the end of the previous ....can any one help me through that?!
code is attached
0 comentarios
Respuesta aceptada
Torsten
el 8 de Abr. de 2016
If you compare with my code, you'll notice that the use of i2 and i3 in these lines is not correct.
v2(i2)=70.*w1;
u2(i2)=70.*w12;
x2(i2)= y1(i+1);
y2(i2)=y1(i+1);
v2(i3)=30.*w2;
u2(i3)=30.*w22;
x2(i3)=y1(i2+1);
y2(i3)=y1(i2+1);
Furthermore, I never introduced v2,u2,x2,y2.
Best wishes
Torsten.
1 comentario
Más respuestas (1)
Image Analyst
el 1 de Abr. de 2016
It's basically like this. Adapt as needed:
for k1 = 1 : 4
k1 % Echo to command window
end
for k2 = (k1+1): (k1 + 5);
k2 % Echo to command window
end
for k3 = (k2+1): (k2 + 2);
k3 % Echo to command window
end
10 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!