MATLAB: How can i find which value of a cell equals to 1 cell arrays Hi everbody, I have a cell array includes [] and 1 elements and i want to find which cell equals to 1. (For ex. 220. cell equals 1.) Thanks… Best Answer If in your cell you have only [] or 1 elements, this works.C={1,[],[],1,[],1}%get indeces of 1sOnesInC = find(~cell2mat(cellfun( @(x) isempty(x) , C , 'UniformOutput' , false )))Otherwise, let me know. Related SolutionsMATLAB: How to random -1 and 1 m=randi(2,8)-1m(~m)=-1%orm=randi([-1 ,1],8)m(~m)=-1%orm=fix(rand(8)+0.5)m(~m)=-1 MATLAB: Delete empty [] {1×7 cell} {1×2 cell} z(cellfun('isempty',z))=[] Related QuestionLogical -1 = Logical 1Find row and collumnumber in matrix.How to turn s/s to 1Array of ints to cell array of stringsCan copula PDF value exceed 1
Best Answer