Concatenate Cell Arrays (string and numeric)
41 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all, I have two cell arrays: tempName & tempWeightSTR. 1. tempName was populated with strings. 2. tempWeightSTR started out as tempWeight which was numeric and I used num2cell to convert it to a cell array.
Is there a way to concatenate the two arrays so the resulting elements look like: ['Paul (20%)', 'John (24%)', 'Ringo (5%)']
I need my results to be one vector, i.e. ['A(1%)','B(2%)','C(3%)']... not [ 'A', 'B', 'C' '1%', '2%', '3%']
I tried strcat(tempName,' (', tempWeightSTR,')') but the numeric values do not show up for some reason.
Also, can someone please point me in the right direction to format the numeric values to string percentages (%)?
Thanks in advance! jason
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!