Command to delete last row and column of a matrix

94 次查看(过去 30 天)
Hi,
Can anyone help me with the command to delete the last row and column of a 6 x 6 matrix?
Regards
Swati

采纳的回答

Alex Mcaulley
Alex Mcaulley 2020-1-28
A(:,end) = []; %Delete last column
A(end,:) = []; %Delete last row

更多回答(1 个)

Bhaskar R
Bhaskar R 2020-1-28
your_matrix(end, :) = []; % deletes your matrix end(last) row
your_matrix(:, end) = []; % deletes your matrix end(last) column

类别

Help CenterFile Exchange 中查找有关 Particle Swarm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by