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

5 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 22 Jul. 2014
rowToDelete = 42; % or whatever....
yourMatrix(rowToDelete, :) = [];
  5 Kommentare
Triveni
Triveni am 9 Mär. 2016
rowToDelete = [42 5 6 7]; % or whatever....
yourMatrix(rowToDelete, :) = [];
should also work...

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by