MATLAB: How to find the position of a number in an cell-array cellarrayfind I have a cell array P= {[2,5], [3], [], [1,14], [], [9]}. I want to find out the number of cell where value 14 is located. Like, here 14 is located inside the cell number 4. How can I do that? Best Answer P= {[2,5], [3], [], [1,14], [], [9]} ;N = length(P) ;val = 14 ;for i = 1:N idx = ismember(14,P{i}) ; if any(idx) break endendiP{i} Related SolutionsMATLAB: Cell to vector transformation idx = cellfun(@isnumeric,d); %find the numeric values in cellarrayout = [d{idx}]; %retrieve values from cell array MATLAB: How to eliminate same strings in a cell-array This works:v = unique(h); Related QuestionManipulation of a cell array-How can thousands of matrix lines be written into a multidimensional cell-arrayNumber of elements in cell arraySeparate data from fileReplace Cell Array with other Cell ArrayDelete empty [] {1×7 cell} {1×2 cell}
Best Answer