Create array with same number
Ältere Kommentare anzeigen
I have this command z=ones(length(x),1) If I want to change (ones) with 2 or 3 what I should do?
Akzeptierte Antwort
Weitere Antworten (2)
José-Luis
am 10 Aug. 2017
twos = 2.* ones(length(x),1)
3 Kommentare
Fadal Sasse
am 10 Aug. 2017
José-Luis
am 10 Aug. 2017
Please accept the answer that best solves your problem.
PY SUN
am 14 Sep. 2018
Thanks
Drue
am 22 Feb. 2023
To create arrays with the same number I'd personally just set a variable and put it in the linspace function
x = 3
poof = input('how many columns of this number do you want?')
linspace(x,x,poof)
Kategorien
Mehr zu Logical 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!