How can I delete an entire row in a matrix and shift the rest of the matrix below the deleted row up each time I delete??
3 次查看(过去 30 天)
显示 更早的评论
I want to delete an entire row and shift the remaining matrix below the deleted row up by one, each time I delete a row.
0 个评论
采纳的回答
Image Analyst
2014-7-22
rowToDelete = 42; % or whatever....
yourMatrix(rowToDelete, :) = [];
5 个评论
Triveni
2016-3-9
rowToDelete = [42 5 6 7]; % or whatever....
yourMatrix(rowToDelete, :) = [];
should also work...
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!