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??

6 ビュー (過去 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.

採用された回答

Image Analyst
Image Analyst 2014 年 7 月 22 日
rowToDelete = 42; % or whatever....
yourMatrix(rowToDelete, :) = [];
  5 件のコメント
Allan N
Allan N 2014 年 7 月 24 日
Many thanks to both Michael and Image Analyst. Yes, it definitely worked!
Triveni
Triveni 2016 年 3 月 9 日
rowToDelete = [42 5 6 7]; % or whatever....
yourMatrix(rowToDelete, :) = [];
should also work...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by