Custom Vector - make vector x to be [1,1,....]
Afficher commentaires plus anciens
Hello Experts,
I want to create a vector x where all n elements are for example c.
I can do this by:
n=5;
x=zeros(1,n);
x(x==0) = 1;
But how to do this in more simple way.
Thanks a lot!
Réponse acceptée
Plus de réponses (1)
bym
le 6 Oct 2011
x = ones(1,5)
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!