フィルターのクリア

hi, i want to find in a binary random matrice position of columns full of zeros (a column of zeros)..

1 回表示 (過去 30 日間)
is there any function in matlab which retur the position of a column ??

採用された回答

Stephen23
Stephen23 2016 年 1 月 11 日
You can use all and find to locate columns containing only zeros:
>> X = randi(2,3,23)-1
X =
0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0
1 0 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 0 0
0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 0
>> find(all(X==0,1))
ans =
3 11 12 23
  2 件のコメント
loukil sana
loukil sana 2016 年 1 月 11 日
hi thanks for your answer.. i have an other question please. why i can't find the boucle do...while(cond) in matlab? is there any other function to replace it?
Stephen23
Stephen23 2016 年 1 月 11 日
編集済み: Stephen23 2016 年 1 月 11 日
MATLAB does not have do ... while. Use this:
while cond
....
end

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by