how to draw two graphs on same figure in matlab

Respuestas (2)

sixwwwwww
sixwwwwww el 7 de Dic. de 2013
x1 = 0:10;
y1 = randi(100, 1, numel(x1));
x2 = 0:100;
y2 = randi(100, 1, numel(x2));
plot(x1, y1, x2, y2)

2 comentarios

Muhammad Aamir
Muhammad Aamir el 7 de Dic. de 2013
two different codes leach and modleach i want both on same graph
sixwwwwww
sixwwwwww el 7 de Dic. de 2013
can you show your codes for leach and modleach?

Iniciar sesión para comentar.

Wayne King
Wayne King el 7 de Dic. de 2013
Editada: Wayne King el 7 de Dic. de 2013
Have you tried simply hold on;
x = randn(100,1);
y = randn(100,1);
plot(x); hold on;
plot(y,'r');
Or simply:
plot(1:length(x),x,1:length(y),y)
If you need different scales for the y-axis see plotyy()

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Dic. de 2013

Comentada:

el 7 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by