필터 지우기
필터 지우기

Adding two vectors of different classes

조회 수: 1 (최근 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 CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by