Effacer les filtres
Effacer les filtres

Adding two vectors of different classes

1 vue (au cours des 30 derniers jours)
gmltn1212
gmltn1212 le 13 Juin 2020
Réponse apportée : KSSV le 13 Juin 2020
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

Réponses (1)

KSSV
KSSV le 13 Juin 2020
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)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by