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!

 Réponse acceptée

Image Analyst
Image Analyst le 26 Nov 2020

0 votes

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

4 commentaires

zakary Surprenant
zakary Surprenant le 26 Nov 2020
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 le 26 Nov 2020
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 le 26 Nov 2020
Yah i added a hold off at the end and it work now, Thanks for your help!
Adam Danz
Adam Danz le 28 Nov 2020

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by