MATLAB Answers

manipulating cells in array.

2 views (last 30 days)
sermet
sermet on 12 May 2014
Answered: 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.

Accepted Answer

Nitin
Nitin on 12 May 2014
% One of the many solutions
t = ismember(A,'0')
A(t)=[];

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.