How to assign values to 100 by 2 matrix?
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (2)
A=[2 3]
A1=[A(1)*ones(100,1) A(2)*ones(100,1)]
Murugan C
le 15 Mai 2019
x=ones(100,2);
x(1:end,1) =2;
x(1:end,2) =3;
Try the above code.
Thanks in advance!!!
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!