How to systematically handle a cell?

1 回表示 (過去 30 日間)
Benson Gou
Benson Gou 2021 年 6 月 29 日
編集済み: Benson Gou 2021 年 6 月 29 日
Dear All,
I have an array Measinj. I want to find out the indecies of Lineon whose 2nd or 3rd columns equal to the entry in Measinj. I used the following code to find the indecies in Lineon.
ind_Lineon = arrayfun(@(x)find(Lineon(:,2)==x | Lineon(:,3)==x),Measinj,'UniformOutput',false);
I got a cell ind_Lineon. The values in Ind_Lineon is the indecies in Lineon. For example,
ind_Linon{1} =
2
5
ind_Lineon{2} =
3
9
12
14
Now I want to find out the values of Lineon(:,4) for each ind_Lineon. each cell in Lineon may contain several indecies.
I am wondering if there is a fast way to find out the Lineon(:,5) for the indecies in ind_Lineon.
Thanks.
Benson

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by