Re: Filtering , and plotting Multi-Dimensional Arrays



Joe Cocker:
<SNIP wants to prune his/her planes...

one of the many solutions

% the planes
m=ceil(3*rand(3,4,3));
% - the threshold/plane
t=[1,3,2];
% the engine
c=squeeze(num2cell(m,[1,2]));
r=cellfun(@(x,y) x==y,c,num2cell(t).','uni',false);
r=cat(3,r{:});
% the result
disp([m,nan(3,1,3),r]);

us
.


Quantcast