How can I add variables on the plot title
116 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
J Kwon
el 28 de Ag. de 2022
Comentada: Abderrahim. B
el 28 de Ag. de 2022
In the code, I use for loop to change my variables(that means the time variation) from 1 to 100.
And I want to add variables on my title to express how the time goes on.
How can I do that thing.
Because I use Matlab 2014b, I can't use any brandnew functions... so I have difficulties.
0 comentarios
Respuesta aceptada
Abderrahim. B
el 28 de Ag. de 2022
Hi!
Pass the for loop index to num2str function then pass this to title. Something like this:
time = 0:1/100:1-1/100 ;
for ii = 1:length(time)
plot( time, ii*time )
title("var" + num2str(ii))
drawnow
end
Hope this helps
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!