manipulating cells in array.

A=[ {'1'},{'1'},{'1'},{'1'},{'0'},{'1'},{'0'},{'1'}] %cell
A=A(:)
%I need to get rid of all zeros from A matrix then I wanna create A matrix again without zeros like that;
B=[ {'1'},{'1'},{'1'},{'1'},{'1'},{'1'}];
B=B(:)

 Respuesta aceptada

Nitin
Nitin el 12 de Mayo de 2014

0 votos

% One of the many solutions
t = ismember(A,'0')
A(t)=[];

Más respuestas (0)

Categorías

Preguntada:

el 12 de Mayo de 2014

Respondida:

el 12 de Mayo de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by