adding to a cell array

1 view (last 30 days)
Jason
Jason on 23 Jul 2011
If I have a cell array of numbers, is it possible to append to this another cell array that consists of text. The text cell array is only 1 column and I simply want to append this column to the leftmost side of the number cell array.
Thanks

Accepted Answer

Walter Roberson
Walter Roberson on 23 Jul 2011
Sure.
[TextCellArray(:), NumericCellArray]
For example,
t = {'hello','Jason'};
n = {1, 2, 3; 4, 5, 6};
[t(:),n]
The result will be
'hello' [1] [2] [3]
'Jason' [4] [5] [6]
  1 Comment
Jason
Jason on 23 Jul 2011
Thank you very much!
Jason

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!