i want to convet a mixture cell array to a cell array that just has string values.

i have a data set ,i convert it to cell array with this code :C = dataset2cell(ds)
but the values of this cell array are double and string. i want dataset values just be string! thanks!

Answers (1)

Use char() to convert string cells to strings. Use num2str() to convert the doubles to strings.

3 Comments

but my data set is 303*15 must i convert it cell by cell? i used this code:for i=2:303 ss=num2str(C{2:i,1}); for one column but does not work and gets me this error:Too many input arguments.
Give a small example of your cell, say 3 rows or so.
u know like these d={30 'hskjhs' 3 'kjk'} f={90 'kj' 3 'kjfk'} can i compare these?

This question is closed.

Tags

Asked:

on 22 Dec 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!