How to assign values to 100 by 2 matrix?
Ältere Kommentare anzeigen
I have a matrix (2,3); how could I initialize a 100 by 2 matrix with the first column all=2 and second column all=3.
Thank you!
Akzeptierte Antwort
Weitere Antworten (2)
A=[2 3]
A1=[A(1)*ones(100,1) A(2)*ones(100,1)]
Murugan C
am 15 Mai 2019
x=ones(100,2);
x(1:end,1) =2;
x(1:end,2) =3;
Try the above code.
Thanks in advance!!!
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!