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!