delete zeros rows and columns
2 views (last 30 days)
Show older comments
i try do delete rows and columns that are zeros but it cut also part of shape .I use this code
u=I;
old=[];
new=all(~u);
while ~isequal(old,new)
u(new,:)=0;
old=new;
new=all(~u);
end
u(new,:)=[];
u(:,new)=[];
av=u;
av(~any(u,2),:)=[];
%radious of puple
figure, imshow(av,[]);
so any other way to do that
0 Comments
Accepted Answer
More Answers (2)
Andrea
on 30 May 2012
data( all( ~any( data), 2 ), : ) = []; % removes all rows with all zero
data( :, all( ~any( data ), 1 ) ) = []; % and columns
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!