フィルターのクリア

find a value in a struct

21 ビュー (過去 30 日間)
elisa ewin
elisa ewin 2017 年 5 月 11 日
編集済み: Guillaume 2017 年 5 月 11 日
Hi,
I have a struct of data (attached) and I want to find in it a value or better the index of the position of this value.
For example, I want to find the value 58 in clusters: it is in the first field clusters(1).cluster, so I want in output 1.
If I want the value '3', it is in the third field clusters(3).cluster so I want in output 3.
can you help me? thanks.

採用された回答

Guillaume
Guillaume 2017 年 5 月 11 日
編集済み: Guillaume 2017 年 5 月 11 日
valuetofind = 58;
find(arrayfun(@(s) ismember(valuetofind, s.cluster), clusters))

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by