フィルターのクリア

problem with matrix selection

2 ビュー (過去 30 日間)
Rica
Rica 2012 年 11 月 12 日
Hi i want to clear some data from a matrix a of size 10*20. i have the index of data to clear. for a vector b we do it lik this: b(index)=[]
how to do it for matrix?

採用された回答

Thomas
Thomas 2012 年 11 月 12 日
編集済み: Thomas 2012 年 11 月 12 日
You will have to clear a row or a column completely
to remove row
a=[1 2 3;4 5 6; 7 8 9]
a(2,:)=[] % remove 2nd row
to remove column
a=[1 2 3;4 5 6; 7 8 9]
a(:,2)=[] % remove 2nd column
otherwise you need to convert them to NaN if removing individually
a=[1 2 3;4 5 6; 7 8 9]
a(2,2)=NaN % convert 2nd row 2nd col to NaN
  1 件のコメント
Rica
Rica 2012 年 11 月 12 日
thx

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by