# how insert char in Cell Array

4 messages
Open this post in threaded view
|

## how insert char in Cell Array

 hi, i want to convert cell in matrix i do an example: c = {"1", "2", "3"; "x", "y", "z"; "4", "5", "6"}; cell2mat(c) ans = 123 xyz 456 But it's wrong.. i want get matrix with :  1 2 3  x y z  4 5 6 I was wrong to enter data in the cell? -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: how insert char in Cell Array

 On Sat, Aug 25, 2018 at 20:57:30 -0500, LucaLuca wrote: > hi, > > i want to convert cell in matrix > > i do an example: > > c = {"1", "2", "3"; "x", "y", "z"; "4", "5", "6"}; > > cell2mat(c) > > ans = > > 123 > xyz > 456 > > But it's wrong.. > > i want get matrix with : >  1 2 3 >  x y z >  4 5 6 Do you really want a 3-by-5 matrix? Do you want A(2,2) to be a space and A(2,5) to be 'z'? If so, then you might want to use the strjoin function to insert spaces. -- mike signature.asc (849 bytes) Download Attachment