|
"Wendy " <wlq121@gmail.com> wrote in message <ilha1o$633$1@fred.mathworks.com>...
> Hi all,
>
> I have a cell array like the following
>
> GeneList =
> 'GeneName' 'EntrezID'
> 'ACVR1' 90
> 'ACVR1B' 91
>
> The class of CellList(2:3,2) is double. I would like to convert the class of these elements to char, so I tried
>
> tf = cellfun('isclass',GeneList(:,2),'double')
>
> tf = 0
> 1
> 1
>
> But I am stuck at how to use the num2str function to the selected cell elements by tf parameter. Does anyone have any suggestion?
>
> Thank you very much,
> Wendy
Try something like
cstr = cellfun( @( num ) num2str( num ), CellList, 'uni', false )
/ per
|