how to remove some row or column of a matrix at once?

lets say i have a 100x100 matrix and i want to remove row 71-100 so it become 100x70 matrix

回答 (2 件)

Arthur
Arthur 2012 年 11 月 6 日
編集済み: Arthur 2012 年 11 月 6 日

0 投票

a = zeros(100,100); %create 100x100 matrix
a(71:100,:) = []; %remove rows 71:100
Sean de Wolski
Sean de Wolski 2012 年 11 月 6 日

0 投票

Note you say row but the new size of your matrix removed columns
Here are two ways to remove columns:
x = x(:,1:70); %glass half full
or
x(:,71:end) = []; %glass half empty

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

eri
2012 年 11 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by