I have below cell array, I want to get the row index if 2nd column is "Continuous" & 3rd Column is <=80.
12 Continuous 891
72 Continuous 23
82 Continuous 562
222 Break 25
132 Continuous 23
832 Break 23
833 Break 23
Desired output(row index):
2
5

 採用された回答

Andrei Bobrov
Andrei Bobrov 2018 年 11 月 28 日

2 投票

C = {12 'Continuous' 891
72 'Continuous' 23
82 'Continuous' 562
222 'Break' 25
132 'Continuous' 23
832 'Break' 23
833 'Break' 23};
C = cell2table(C);
rows = find(ismember(T.C2,'Continuous') & T.C3 <= 80);

その他の回答 (1 件)

Jos (10584)
Jos (10584) 2018 年 11 月 28 日

1 投票

tf1 = strcmp(YourCellArray(:,2), 'Continuous')
tf2 = cat(1, YourCellArray{:,3}) <= 80
DesiredRows = find(tf1 & tf2)

カテゴリ

ヘルプ センター および File ExchangeSimultaneous and Synchronized Operations についてさらに検索

製品

リリース

R2016a

質問済み:

2018 年 11 月 28 日

回答済み:

2018 年 11 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by