필터 지우기
필터 지우기

How to plot a graph for three variables?

조회 수: 15 (최근 30일)
Anandh
Anandh 2011년 10월 15일
Hi,
I have three variables x,y1 and y2. I would like to plot a graph with x axis and two y axis as y1 and y2. How to do this?please reply. Thanks.

답변 (1개)

Ali Isik
Ali Isik 2011년 10월 15일
My solution is using both left and right of x axis to plot y axises. To do it, you should use plotyy() function, Here is an example code;
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
plotyy(x,y1,x,y2);

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by