Concatenate the index i within the loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Amanda Camarata
am 9 Dez. 2023
Kommentiert: Dyuman Joshi
am 9 Dez. 2023
I'm trying to create a list for my legend without hard coding it, but I'm having trouble figure out how to concatenate the number associated with 'i' in my loop.
I'm hoping I'll end up with a list of strings = ['Node 1','Node 2','Node 3'....]
num_labels = 10;
labels = zeros(1,num_labels);
for i = 1:num_labels
labels(1,i) = strcat('Node',i);
end
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!