Search for an element in cell array?

27 ビュー (過去 30 日間)
Soumyatha Gavvala
Soumyatha Gavvala 2016 年 6 月 24 日
コメント済み: Soumyatha Gavvala 2016 年 6 月 24 日
So I have a dataset as follows
NaN 51.1512 4.0000 6.0000
NaN 80.7646 3.0000 6.0000
NaN 89.3755 2.0000 6.0000
NaN 96.3119 1.0000 6.0000
NaN 51.1512 8.0000 5.0000
NaN 80.7646 7.0000 5.0000
5.1104 89.3755 6.0000 5.0000
NaN 96.3119 5.0000 5.0000
9.0177 51.1512 12.0000 4.0000
NaN 80.7646 11.0000 4.0000
5.3294 89.3755 10.0000 4.0000
now, I want the element in row 3, for a value of say 5 from row 4 and a value of 89.3755 of row 2, which is 6.0000.
Can you tell me how to do that? Thanks!
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 24 日
I am not sure, but I think you are confusing rows and columns, which makes your question not clear

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 24 日
編集済み: Azzi Abdelmalek 2016 年 6 月 24 日
A=[NaN 51.1512 4.0000 6.0000
NaN 80.7646 3.0000 6.0000
NaN 89.3755 2.0000 6.0000
NaN 96.3119 1.0000 6.0000
NaN 51.1512 8.0000 5.0000
NaN 80.7646 7.0000 5.0000
5.1104 89.3755 6.0000 5.0000
NaN 96.3119 5.0000 5.0000
9.0177 51.1512 12.0000 4.0000
NaN 80.7646 11.0000 4.0000
5.3294 89.3755 10.0000 4.0000]
idx=find(ismember(A(:,2),89.3755)&ismember(A(:,4),6))
out=A(idx,:)
  1 件のコメント
Soumyatha Gavvala
Soumyatha Gavvala 2016 年 6 月 24 日
That helped! Thank you very much!

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

その他の回答 (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