Adding two vectors of different classes

2 ビュー (過去 30 日間)
gmltn1212
gmltn1212 2020 年 6 月 13 日
回答済み: KSSV 2020 年 6 月 13 日
Hi I am trying to add to vectors of different classes:
a = [13 13 14 15 14 15 13 14 15]; %double
b = 'ABAABBAAB'; %char
I want to return this
c = '13A 13B 14A 15A 14B 15B 13A 14A 15B'; %string

回答 (1 件)

KSSV
KSSV 2020 年 6 月 13 日
a = [13 13 14 15 14 15 13 14 15]; %double
b = 'ABAABBAAB'; %char
b = num2cell(b) ;
a = strsplit(num2str(a)) ;
iwant = strcat(a,b)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by