Create Plot Title of the Plotted Function

1 visualización (últimos 30 días)
Forrest Graham
Forrest Graham el 8 de Abr. de 2020
Comentada: Forrest Graham el 8 de Abr. de 2020
How can I make the title of a plot the function I am plotting?
Here is the code trying to use:
x = 0:.01:1;
for i= 1:9
subplot(3,3,i)
y = x.^i;
plot(x, y, 'black')
xlabel('x')
ylabel('y')
% title()???
end

Respuesta aceptada

Bhaskar R
Bhaskar R el 8 de Abr. de 2020
x = 0:.01:1;
for i= 1:9
subplot(3,3,i)
y = x.^i;
plot(x, y, 'black')
xlabel('x')
ylabel('y')
title(['Title\_' sprintf('%d', i)])
end
  1 comentario
Forrest Graham
Forrest Graham el 8 de Abr. de 2020
Thank you! I was able to display the exponential function as the title for each subplot using this. :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by