フィルターのクリア

Concatenate String and Numbers Horizontally

5 ビュー (過去 30 日間)
Amanda
Amanda 2013 年 2 月 19 日
I have 3 columns of data: 1 string and 2 number
a = [ 'A';'B';'C'] b = [75; 85; 95] c = [89; 95; 58]
I am trying to horizontally concatenate a,b,c into one array of d. As seen below:
'A' 75 89
'B' 85 95
'C' 95 58
Some reason it is the combination of stings and numbers that is causing the problem.
Thanks, Amanda

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 19 日
編集済み: Azzi Abdelmalek 2013 年 2 月 19 日
You should use a cell array
out=[cellstr(a) num2cell(b) num2cell(c)]
  1 件のコメント
Amanda
Amanda 2013 年 2 月 19 日
Thanks a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by