I havr a cell myCell 1x200 Each cell contains set of three values like myCell{1,1} = 1,118,180 ... myCell{1,8}= 1,122,185 and so on If I have to use find function by providing all three values, how should I use?

 채택된 답변

Jan
Jan 2019년 5월 7일
편집: Jan 2019년 5월 7일

0 개 추천

Do all elemts of the cell have the same size and type? Then working with a numerical array is easier and faster:
M = cat(1, myCell{:});
match = find(ismember(M, [1,2,128], 'rows'))
% or
find(M == [1,2,128]) % auto-expanding, >=Matlab R2016b

추가 답변 (1개)

Adam
Adam 2019년 5월 7일

1 개 추천

wantedArray = [1,122,185];
cellfun( @(x) isequal(x,wantedArray), myCell );
You would be better off using a numeric array though for neatly structured data.

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2019년 5월 7일

댓글:

2019년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by