concatenate a cell array(string) and a double array numeric
古いコメントを表示
i have 2 arrays:
x = {'tom' 'sara' 'bob'} y = [ 1 2 3 ; 3 4 5 ; 1 4 2]
how can i concatenate x and y vertically with a single array with x as header?
1 件のコメント
Jan
2012 年 3 月 28 日
This topic has been discussed already: http://www.mathworks.com/matlabcentral/answers/33087-how-to-combine-an-cell-array-and-a-double-array
Please do not double-post.
回答 (1 件)
Andrei Bobrov
2012 年 3 月 28 日
out = [x;num2cell(y)];
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!