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 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Image Analyst
Image Analyst le 22 Juil 2014
rowToDelete = 42; % or whatever....
yourMatrix(rowToDelete, :) = [];
  5 commentaires
Allan N
Allan N le 24 Juil 2014
Many thanks to both Michael and Image Analyst. Yes, it definitely worked!
Triveni
Triveni le 9 Mar 2016
rowToDelete = [42 5 6 7]; % or whatever....
yourMatrix(rowToDelete, :) = [];
should also work...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by