how to draw two graphs on same figure in matlab

i want to compare two graph for this i need to draw both on same figure.how can i do this?

답변 (2개)

sixwwwwww
sixwwwwww 2013년 12월 7일

0 개 추천

x1 = 0:10;
y1 = randi(100, 1, numel(x1));
x2 = 0:100;
y2 = randi(100, 1, numel(x2));
plot(x1, y1, x2, y2)

댓글 수: 2

two different codes leach and modleach i want both on same graph
can you show your codes for leach and modleach?

댓글을 달려면 로그인하십시오.

Wayne King
Wayne King 2013년 12월 7일
편집: Wayne King 2013년 12월 7일

0 개 추천

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()

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

질문:

2013년 12월 7일

댓글:

2013년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by