I can't get to add a linear fit line,
This is my code ma and me can be ignored it is for the other plots,
and this the graph i get, i just need to have a linear fit added into it!

 채택된 답변

Image Analyst
Image Analyst 2020년 11월 26일

0 개 추천

Add this:
hold on;
plot(x, curve, 'b-', 'LineWidth', 3);

댓글 수: 4

zakary Surprenant
zakary Surprenant 2020년 11월 26일
I have a stackedplot higher up in my script so the first time i run with this it works but when i rerun it it says error and that my stackedplot needs to be hold off, and idea
Image Analyst
Image Analyst 2020년 11월 26일
I don't know why that would be true. Maybe at the beginning of your script put
close all;
So that no figure is open when you rerun it, and it will draw everything from scratch. Or you could try
cla reset;
if you wanted to keep the figure from prior runs up for some reason.
zakary Surprenant
zakary Surprenant 2020년 11월 26일
Yah i added a hold off at the end and it work now, Thanks for your help!
Adam Danz
Adam Danz 2020년 11월 28일

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

추가 답변 (0개)

카테고리

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

태그

질문:

2020년 11월 26일

댓글:

2020년 11월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by