Assigning count values to the column of a matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I have a matrix A with the size 29x3 and I want to fill third column with the numbers from 29(the max lenght) to 1.
Is there a possible way to do it without using loops?
Regards
댓글 수: 0
채택된 답변
Stephen23
2019년 1월 27일
Either one of these, depending on the order that you want:
A(:,3) = 1:29
A(:,3) = 29:-1:1
댓글 수: 0
추가 답변 (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!