For loops in Matlab
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
C=[ ];
for A=1:4
B=[5 10 5 10];
end
C=[A,B]
for example :
A=1:4
and
B=[5 10 5 10]
if A==1 & 3 then B==5, and when A==2&4 B==10
A B
1 5
2 10
3 5
4 10
How we could use Matlab code to obtain the above loop as shown in the picture, Thank you in advance for your assistance,
0 Commenti
Risposta accettata
Amit
il 18 Gen 2014
Modificato: Amit
il 18 Gen 2014
I think simple doing
C = [A' B'];
would work. You dont need to do this in a loop.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!