Merge a matrix of VALUE: DOUBLE and VALUE: CELL

1 view (last 30 days)
Hello all,
I have two varibles in my workspace. One is of type "Double" and contain COLUMNS of NUMERICAL DATA, and the other is of type "Cell" and contains COLUMNS of data like STRINGS and qualitative notes.
I'm trying to merge this data into a single variable, with rows containing BOTH "Double" and "Cell" type data.'
THANKS!!!
-C

Answers (1)

Sean de Wolski
Sean de Wolski on 7 Jul 2011
Make a new cell that holds both of them:
C = {numerical_data,cell_data}
or similar
  2 Comments
Christopher
Christopher on 7 Jul 2011
this kind of solves my problem. But i have my code set up in such a way that I actually need them separated until the end.
Is there any way to export the data into a new variable where they can co-exist in the same row (after the fact)?
Thanks
Oleg Komarov
Oleg Komarov on 7 Jul 2011
You cannot have a double matrix with numbers ans strings but you can have a cell array which contians both, i.e. Sean's answer.
C = {1:10,'Numbers from 1 to 10'}

Sign in to comment.

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!