How to assign the result of a row deletion operation to a new matrix?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a 10X10 matrix, from which I delete the row 3 applying A(3,:)= [] . I want to save the original matrix and have the new matrix with a deleted row assigned to a new variable C. Now how do I assign this result to a new matrix C?
I do C= A(3,:)=[] but it is obviously wrong.
Thank you!
댓글 수: 0
채택된 답변
Star Strider
2023년 1월 17일
I would do something like this —
A = magic(10) % Save Original
C = A; % Copy 'A' To 'C'
C(3,:) = [] % Delete Row 3 From 'C'
.
댓글 수: 4
추가 답변 (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!