Hei
I plot two lines using
plot(1961:2017,res(:,2))
hold on
plot(1961:2017,res(:,4),'--')
Then in figure clicking on Tools I can do basic linear fitting through series one (data1)
When I also want to do a linear fit through series two(data2), the first fit disappears
How can I keep both linear fits (through data1 and data2) in place
I tried lsline but this can only be applied to scatter (x,y) it looks like
What other possibilities are there.
Regards
Johannes

 채택된 답변

Luna
Luna 2019년 1월 22일

0 개 추천

Try to define the axis handle inside the figure. Than hold it:
hFig = figure;
hAxis = axes(hFig);
hold(hAxis,'on')
plot(hAxis,data1,'*r');
plot(hAxis,data2,'b');

댓글 수: 4

Johannes Deelstra
Johannes Deelstra 2019년 1월 22일
Thanks for answering, but how can I do the linear fitting through both data sereies 1 and 2
Luna
Luna 2019년 1월 22일
Share your sample data and what have you done so far. So that we can help you.
Johannes Deelstra
Johannes Deelstra 2019년 1월 22일
Hei Luna
I fixed the problem by using polyfit and polyval
Thanks for helping
Luna
Luna 2019년 1월 22일
Your welcome :)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기

질문:

2019년 1월 22일

댓글:

2019년 1월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by