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!