horzcat cell array of string

3 ビュー (過去 30 日間)
Mederic Mainson
Mederic Mainson 2016 年 9 月 21 日
コメント済み: KSSV 2016 年 9 月 21 日
Hi Guys, I am a bit buffled, it shouldnt be so hard. I have a cell array of strings, see image below for details. I want to combine the 2 colunms of this cell array into one colunm. i do this:
B=[A{:,1} A{:,2}];
But it combines everything into one unique cell... Help please. Cheers Medie

採用された回答

Walter Roberson
Walter Roberson 2016 年 9 月 21 日
strcat(A(:,1), {' '}, A(:,2))

その他の回答 (1 件)

KSSV
KSSV 2016 年 9 月 21 日
a1 = {'2016/09/20'} ;
a2 = {'03:16:38'} ;
strcat(a1,a2)
  4 件のコメント
Walter Roberson
Walter Roberson 2016 年 9 月 21 日
That will not leave the customary space between the parts. The strcat I show will add in the space.
KSSV
KSSV 2016 年 9 月 21 日
space can be added using: strcat(a1,{' '},a2). I was thinking he wanted to merge them into single.

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

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by