How to add numeric values to cell array?
Ältere Kommentare anzeigen
names = {'A' 'B' 'C' 'D' 'E'};
val = [0;1.5;0.5;0.5;1.5]
I want my output as folows
A 0
B 1.5
C 0.5
D 0.5
E 1.5
Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 7 Apr. 2021
for k=1:length(names)
names{k}=[names{k},' ',num2str(val(k))];
end
1 Kommentar
Souarv De
am 7 Apr. 2021
Kategorien
Mehr zu Data Types finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!