Custom Vector - make vector x to be [1,1,....]
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (1)
bym
il 6 Ott 2011
x = ones(1,5)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!