manipulating cells in array.

1 次查看(过去 30 天)
sermet
sermet 2014-5-12
回答: Nitin 2014-5-12
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(:)

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by