delete a row, or column.

1 回表示 (過去 30 日間)
ck
ck 2016 年 7 月 5 日
コメント済み: ck 2016 年 7 月 5 日
I have a matrix 'b' with 1201 rows and 1 column(1203x1), but the last row is not needed and I want to delete the last row making it (1200x1).
Can I use any function for this?
Thank you

採用された回答

James Tursa
James Tursa 2016 年 7 月 5 日
編集済み: James Tursa 2016 年 7 月 5 日
Not sure if you have a 1201x1 or a 1203x1. But to delete the last row:
b(end,:) = [];
To retain the first 1200 rows:
b = b(1:1200,:);
If b is 1201x1 these will give the same result.
Since you have a column vector I really didn't need the : for the columns, but decided to include it since that form will work for a matrix also.
  1 件のコメント
ck
ck 2016 年 7 月 5 日
Thanks ! it helped!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by