Command to delete last row and column of a matrix

100 ビュー (過去 30 日間)
Swati Sarangi
Swati Sarangi 2020 年 1 月 28 日
コメント済み: Bhaskar R 2020 年 1 月 28 日
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
  2 件のコメント
Swati Sarangi
Swati Sarangi 2020 年 1 月 28 日
Hi,
Thanks for replying.
I just want to know the reason for assigning the final result to an empty matrix.
Regards
Swati

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeParticle Swarm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by