Info

This question is closed. Reopen it to edit or answer.

how can i create a matrix with elements of a number matrix and cell arry?

1 view (last 30 days)
Hello,
I would like to know how I can easily to combine number matrix with a cell array and to create a new matrix?
  2 Comments
nancy k
nancy k on 17 Dec 2015
Edited: James Tursa on 17 Dec 2015
thanks a lot, I have this two below
C = cell(480,1);
a = zeros(480,5);
and i want as output in my variable editor to create a new matrix that to be composed of the C( in first col) and the rest of the new matrix from the a

Answers (1)

the cyclist
the cyclist on 17 Dec 2015
Here is one way that might help you (but I echo James Tursa's comment that more detail would be helpful):
A = {'alpha';'beta';'gamma'}
M = [1;2;3]
C = [A, num2cell(M)]

Tags

Community Treasure Hunt

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

Start Hunting!