MATLAB Answers

How to get row index satisfy the condition in cell array

13 views (last 30 days)
Mekala balaji
Mekala balaji on 29 Jun 2019
Commented: madhan ravi on 29 Jun 2019
I have celle array, and want to find row index where the cell value is equal to 1.
'Group1' 'PVT' 'Power' '01-06-2019' [0]
'Group1' 'PVT' 'Power' '01-06-2019' [1]
'Group1' 'PVR' 'VFT' '01-06-2019' [1]
'Group1' 'PMR' 'VGA' '01-06-2019' [1]
I want to get row where the value is equal to 1 in last column. I tried below code but does not work.
IndexC = strfind(cell2mat(data{:,end}),'1');
Both does not worlk.

Accepted Answer

madhan ravi
madhan ravi on 29 Jun 2019
The last column doesn't seem to be a char:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by