creating matrix by iteration 2
Mostra commenti meno recenti
Hi Everyone how are You? Can U help with this PLEASE: n=4 for i=1:n s=i if s == 3 for k =1:2 A(i,1) =s A(s+1,1)=s end else A(i,1) =s end end I want like this result: A=[1;2;3;3;4]. which if s == 3 it should be repeated 2 times in the matrix.
5 Commenti
Azzi Abdelmalek
il 9 Ago 2014
Format correctly your code
Akmyrat
il 9 Ago 2014
Azzi Abdelmalek
il 9 Ago 2014
Is this a homework?
Akmyrat
il 9 Ago 2014
Jan
il 10 Ago 2014
@Akmyrat: This is a final project? And you solve it by asking a public forum? Impressing.
Risposta accettata
Più risposte (1)
Roger Stafford
il 9 Ago 2014
A = floor((15:8:47)'/10);
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!