フィルターのクリア

Using the find function

1 回表示 (過去 30 日間)
Anthony
Anthony 2012 年 4 月 20 日
A= magic(4)
for z= 1:4
position(z) = find(A(:,z)>10,1)
end
I want to use the find function to find all the values greater than 10 . this will enable me use the command A(position) to get all the values greater than 10 in a matrix. Is this possible with matlab?

採用された回答

Thomas
Thomas 2012 年 4 月 20 日
A= magic(4)
[row,col]=find(A>10)
should give you all positions of values in a Which are > 10
To find the actual values in A which are > 10 use
A(A>10)
ans =
16.00
11.00
14.00
15.00
13.00
12.00

その他の回答 (1 件)

Anthony
Anthony 2012 年 4 月 20 日
Thank you Thomas. The reason I am looking for the position is because I want to use these positions to access other values in a matrix named Zone. Zone is defined by: Zone = [3 5 7 9; 4 7 8 2; 4 6 7 8; 5 1 3 2]
So how do I relate the positions from A to the values I want in Zone? basically what I want from Zone is [3,7,1,3,9,8]. Is this possible?
  1 件のコメント
Thomas
Thomas 2012 年 4 月 20 日
Zone(A>10)
should do the trick..

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by