Command to delete last row and column of a matrix

47 Ansichten (letzte 30 Tage)
Swati Sarangi
Swati Sarangi am 28 Jan. 2020
Kommentiert: Bhaskar R am 28 Jan. 2020
Hi,
Can anyone help me with the command to delete the last row and column of a 6 x 6 matrix?
Regards
Swati

Akzeptierte Antwort

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

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by