How to plot all figures in only one plot?
    9 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    GULZAR
 el 24 de Ag. de 2023
  
How to plot all figures in one plot (like hold on hold off command) using for loop. I don't need 12 subplots. I need 12 figures in one plot.
clc; clearvars; close all;
x=-10:0.1:10;
c=-6:5;
for i=1:length(c)
    y=c(i)*x.^(2)+4*x+2;
    subplot(3,4,i)
    plot(x,y)
    xlabel('x')
    ylabel('y')
end
0 comentarios
Respuesta aceptada
  Alan Stevens
      
      
 el 24 de Ag. de 2023
        Here's one simple way:
x=-pi:0.1:pi;
c=-6:5;
figure
hold on
for i=1:length(c)
    y=c(i)*x.^(2)+4*x+2;
    plot(x,y)
end
xlabel('x')
ylabel('y')
hold off
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!





