From: sujata on
Hello

I have a 30 by 3 cell matrix that is like this. My question is if I select the second (or third) column how can I filter out the empty cells ''. I only want to choose those entries that have actual text data. I tried char which doesn't really get me what I want.

Can anyone help?

'text5' 'text38' 'text57'
'text6' 'text39' 'text58'
'text7' 'text40' 'text59'
'text8' 'text41' 'text60'
'text9' 'text42' 'text61'
'text10' 'text43' 'text62'
'text11' 'text44' 'text63'
'text12' 'text45' 'text64'
'text13' 'text46' 'text65'
'text14' 'text47' ''
'text15' 'text48' ''
'text16' 'text49' ''
'text17' 'text50' ''
'text18' 'text51' ''
'text19' 'text52' ''
'text20' '' ''
'text21' '' ''
'text22' '' ''
'text23' '' ''
'text24' '' ''
'text25' '' ''
'text26' '' ''
'text27' '' ''
'text28' '' ''
'text29' '' ''
'text30' '' ''
From: Jos (10584) on
"sujata" <sujatagp(a)gmail.com> wrote in message <hjp04t$src$1(a)fred.mathworks.com>...
> Hello
>
> I have a 30 by 3 cell matrix that is like this. My question is if I select the second (or third) column how can I filter out the empty cells ''. I only want to choose those entries that have actual text data. I tried char which doesn't really get me what I want.
>
> Can anyone help?
>
> 'text5' 'text38' 'text57'
> 'text6' 'text39' 'text58'
> 'text7' 'text40' 'text59'
> 'text8' 'text41' 'text60'
> 'text9' 'text42' 'text61'
> 'text10' 'text43' 'text62'
> 'text11' 'text44' 'text63'
> 'text12' 'text45' 'text64'
> 'text13' 'text46' 'text65'
> 'text14' 'text47' ''
> 'text15' 'text48' ''
> 'text16' 'text49' ''
> 'text17' 'text50' ''
> 'text18' 'text51' ''
> 'text19' 'text52' ''
> 'text20' '' ''
> 'text21' '' ''
> 'text22' '' ''
> 'text23' '' ''
> 'text24' '' ''
> 'text25' '' ''
> 'text26' '' ''
> 'text27' '' ''
> 'text28' '' ''
> 'text29' '' ''
> 'text30' '' ''

help cellfun

Jos