MATLAB Answers

0

manipulating cells in array.

Asked by sermet on 12 May 2014
Latest activity Answered by Nitin
on 12 May 2014
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(:)

  0 Comments

Sign in to comment.

1 Answer

Nitin
Answer by Nitin
on 12 May 2014
 Accepted Answer

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

  0 Comments

Sign in to comment.