I want to illustrate the vaulves of two 11*1 vectots on the same axes in the terms of t=0:0.1:1. The min and max values of these two vectors are far from each other. So, the "plot" command doesn't give the expand result of "y"-axis. Even I applyed the "axes" command, but I didn't get suitable result again. I attached the picture of this figure. How can I asolve this problem?

댓글 수: 3

GandaBerunda
GandaBerunda 2022년 7월 6일
Do you want two different y axes for the same x axis? have I understood the question correctly?
GandaBerunda
GandaBerunda 2022년 7월 6일
If yes, I guess this can help : https://mathworks.com/help/matlab/creating_plots/plotting-with-two-y-axes.html
Zeinab Hassanzadeh
Zeinab Hassanzadeh 2022년 7월 7일
Thank you very mucg, I want to y axes to be scaled from 10^(-6) to 10 with the efficient stepsize. But in this figure (current picture) the domain of the y axes only showed from 0 to 1.8.

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

 채택된 답변

Image Analyst
Image Analyst 2022년 7월 6일

0 개 추천

Try yyaxis
t = linspace(0,10);
TSWR = sin(3*t);
yyaxis left
plot(t, TSWR, 'LineWidth', 2)
ylabel('TSWR')
xlabel('t')
OMC = 0.001 * sin(3*t).*exp(0.5*t);
yyaxis right
plot(t, OMC, 'LineWidth', 2)
ylabel('OMC')
grid on;
% ylim([-.001, 0.001])
legend('TSWR', 'OMC')

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by