Create array with same number
古いコメントを表示
I have this command z=ones(length(x),1) If I want to change (ones) with 2 or 3 what I should do?
採用された回答
その他の回答 (2 件)
José-Luis
2017 年 8 月 10 日
twos = 2.* ones(length(x),1)
3 件のコメント
Fadal Sasse
2017 年 8 月 10 日
José-Luis
2017 年 8 月 10 日
Please accept the answer that best solves your problem.
PY SUN
2018 年 9 月 14 日
Thanks
Drue
2023 年 2 月 22 日
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)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!