How can I add a column of zeros to a magic 5x5 matrix A to create a 5x6 matrix C?
조회 수: 5 (최근 30일)
이전 댓글 표시
How can I add a column of zeros to a magic 5x5 matrix A to create a 5x6 matrix C? The element value in the 6th column should all be zero.
댓글 수: 0
채택된 답변
Image Analyst
2014년 6월 17일
편집: Image Analyst
2014년 6월 17일
Try this:
A = magic(5)
C = A; % Initialize a brand new matrix called C that is the same as A.
C(5,6) = 0 % Add column 6 that is all zeros.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!