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 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by