Find specific cell in another cells
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ting-Yu Chueh
am 21 Apr. 2019
Bearbeitet: Ting-Yu Chueh
am 21 Apr. 2019
Hi everyone,
Attachment is my file.
I would like to know the locations of this cells containes a specific cell-{21 31 1}
I try to use like below:
Match = {21 31 1};
CorrectMatch = find (cellfun(@(x) isequal (x,Match), condition(1,:)));
but it return 0.
Could any one help me?
2 Kommentare
Akzeptierte Antwort
Walter Roberson
am 21 Apr. 2019
match = {21 31 1}
does not exist in your actual condition variable. Your actual condition is a cell array of cell arrays of character vectors such as {'21' '31' '1'}
match = {21 31 1};
mm = cell2mat(match); %eg [21 31 1]
CorrectMatch = find( cellfun(@(c) isequal(str2double(c), mm),condition) );
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!