Command to delete last row and column of a matrix

98 visualizaciones (últimos 30 días)
Swati Sarangi
Swati Sarangi el 28 de En. de 2020
Comentada: Bhaskar R el 28 de En. de 2020
Hi,
Can anyone help me with the command to delete the last row and column of a 6 x 6 matrix?
Regards
Swati

Respuesta aceptada

Alex Mcaulley
Alex Mcaulley el 28 de En. de 2020
A(:,end) = []; %Delete last column
A(end,:) = []; %Delete last row

Más respuestas (1)

Bhaskar R
Bhaskar R el 28 de En. de 2020
your_matrix(end, :) = []; % deletes your matrix end(last) row
your_matrix(:, end) = []; % deletes your matrix end(last) column
  2 comentarios
Swati Sarangi
Swati Sarangi el 28 de En. de 2020
Hi,
Thanks for replying.
I just want to know the reason for assigning the final result to an empty matrix.
Regards
Swati

Iniciar sesión para comentar.

Categorías

Más información sobre Particle Swarm en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by