From: Alan B on 1 Jul 2010 11:45 "ade77 " <ade100a(a)gmail.com> wrote in message <i0i635$hhk$1(a)fred.mathworks.com>... > For example I have a cell array : > > A = {'you' 'me' 'go' ' ' 'give'}, this cell array has a many empty string (''), what will be the best option to remove this empty string. > > Thanks for any hint Try using cellfun() with isempty().
From: Nathan on 1 Jul 2010 13:17 On Jul 1, 6:44 am, "ade77 " <ade1...(a)gmail.com> wrote: > For example I have a cell array : > > A = {'you' 'me' 'go' ' ' 'give'}, this cell array has a many empty string (''), what will be the best option to remove this empty string. > > Thanks for any hint This can be done without cellfun: A = {'you' 'me' 'go' '' 'give'}; A(strcmp('',A)) = []; %%%%%%%%%%%%% A = 'you' 'me' 'go' 'give' -Nathan
From: ade77 on 1 Jul 2010 14:11 Nathan <ngreco32(a)gmail.com> wrote in message <cb00de37-cde6-4d98-8181-9ac2170e351b(a)t10g2000yqg.googlegroups.com>... > On Jul 1, 6:44 am, "ade77 " <ade1...(a)gmail.com> wrote: > > For example I have a cell array : > > > > A = {'you' 'me' 'go' ' ' 'give'}, this cell array has a many empty string (''), what will be the best option to remove this empty string. > > > > Thanks for any hint > > This can be done without cellfun: > A = {'you' 'me' 'go' '' 'give'}; > A(strcmp('',A)) = []; > > %%%%%%%%%%%%% > A = > 'you' 'me' 'go' 'give' > > > -Nathan Deep Appreciation (Nathan , Alan)
|
Pages: 1 Prev: Question Synchronization Next: load matrix from workspace to simulink |