Concatenate the index i within the loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amanda Camarata
el 9 de Dic. de 2023
Comentada: Dyuman Joshi
el 9 de Dic. de 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 comentario
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Axis Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!