Create array with same number
조회 수: 683 (최근 30일)
이전 댓글 표시
I have this command z=ones(length(x),1) If I want to change (ones) with 2 or 3 what I should do?
댓글 수: 0
채택된 답변
James Tursa
2018년 9월 14일
편집: James Tursa
2018년 9월 14일
See this link for a discussion of various methods to do this:
The fastest method seems to be
z = zeros(length(x),1) + 2;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!