How do I write in For loop 2 condition
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I would like to create script for For Loop in 2 factors
1. "A" very 0:0.2:40
2. "B" very 0:0.2:40
How do I create that
Could you please suggest method to solve that
Thank you
0 comentarios
Respuestas (1)
Walter Roberson
el 27 de Jul. de 2015
for A = 0:0.2:40
for B = 0:0.2:40
...
end
end
or
for AB = [0:0.2:40;0:0.2:40]
A = AB(1); B = AB(2);
...
end
or
Avals = 0:0.2:40;
Bvals = 0:0.2:40;
for K = 1 : length(Avals)
A = Avals(K);
B = Bvals(K);
...
end
I do not recommend using the AB version: it is obscure and would confuse most readers.
0 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!