Naming figure with a loop

6 visualizaciones (últimos 30 días)
Mehrnaz
Mehrnaz el 2 de Nov. de 2017
Comentada: Mehrnaz el 2 de Nov. de 2017
I want to name my figures with 2 pieces of information, one that is constant for all images and one that arises from a loop. For example, I want the code to generate 4 plots with the following titles:
Doubling Time Tobramycin
Doubling Time Amikacin
Doubling Time Clindamycin
Doubling Time Tetracycline
I am making the 4 plots using a loop and I have the antibiotic names saved as Drug.{1}, 2 , 3. etc. How should I write it so that part of the title stays constant and the second part changes each time.
Thanks.

Respuesta aceptada

KL
KL el 2 de Nov. de 2017
for k = 1:numel(D)
f(k) = figure(k)
h(k) = plot(...)
title(['Doubling Time ' D{k}])
end
  1 comentario
Mehrnaz
Mehrnaz el 2 de Nov. de 2017
Brilliant, thanks so much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by