delete zeros rows and columns
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 1 de Mzo. de 2012
u = I;
zc = ~any(u);
zr = ~any(u,2);
u(zc,zr) = [];
imshow(u, []);
1 comentario
Isee You
el 2 de Mzo. de 2012
Andrea
el 30 de Mayo de 2012
1 voto
data( all( ~any( data), 2 ), : ) = []; % removes all rows with all zero
data( :, all( ~any( data ), 1 ) ) = []; % and columns
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!