how to scale two plots

조회 수: 6 (최근 30일)
Beenish Mazhar
Beenish Mazhar 2013년 3월 25일
I am having a very common question; but still I am helpless and found no solution for it. I am having two plots. I want to scale one plot with respect to other. On x-axis; I have scaling from 1 to 60 while on y-axis; from -100 to 500. For the second plot the x-axis has range from 0 to 9000 while y-axis has same range -100 to 500. If I scale the x-axis of second plot with respect to first one only first 60 values are shown while remaining are discarded. If I scale the first plot with respect to second one then nothing is visible only a very small line is seen on the plot. The piece of code is:
figure
axis([0 9000 -100 500])
hold on
plot(value)

채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 25일
plotxx() from the File Exchange, perhaps.
But do the two ranges, 0-60 and 0-9000, represent the same range of values?
You are using the one-argument form of plot(). Do you have a list of x for each of the two cases? If so then,
plot(timelist1, valuelist1, timelist1, valuelist2)
  댓글 수: 7
Walter Roberson
Walter Roberson 2013년 3월 26일
You cannot judge efficiency just by iterations, if what is being iterated is not the same thing, or if the answers are not to the same tolerance.
Guessing from the plots, it appears to me that the one that converges after 60 values is taking a coarser step size or using a steeper descent approach on something like an ODE, which is fine when it works, but risks missing local extrema that could possibly be important.
Beenish Mazhar
Beenish Mazhar 2013년 3월 26일
Sir you have guessed the right thing; the ODE's for both plots are different. Actually in order to achieve the desired response ODE's were changed because desired response was not achieved by using the same ODE for both plots.Sir would this matter? One thing more sir; when we change ODE'S actually we are changing the step sizes?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by