MATLAB: Row filtering and pre-allocate row filtering hi all, here p is (1,3) vector,: how can I preallocate a. how can store each filtered rows in a seperate matrix. Regards for i=1:length(L); a=p(p(:,3)==L(i),:); end Best Answer a = cell(numel(L),1);for ii = 1:numel(L); a{ii} = p(p(:,3) == L(ii),:);endcelldisp(a)%ora = num2cell(p(any(p(:,3) == L, 2), :),2)
Best Answer