I am using Matlab to fit some data in 2 coordinates (x,y) with a poly1 curve.
The problem is that I can't find a way to make the fitting line longer.
I need it from (180, 930) to (191, 944), but instead Matlab just draw the fitting line near the data, which is between those two coordinates.
Is there some argument to the fit command (or some preferences in the cftool) that can help me out?
Moreover, I've tried the "Adjust axes limits" option in the cftool, but it didn't help at all.
I've searched through the already asked questions, but I haven't found anything related to this.
I'm new to this program, therefore I'm sorry if this is a stupid question
Thanks in advance,
Giovanni
EDIT:
The code for the first image is:
[FitUp,goodnessUP] = fit(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,2),'poly1')
[FitDown,goodnessDOWN] = fit(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,3),'poly1')
plot(FitUp,'b')
hold on
plot(FitDown,'b')
hold on
errorbar(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,2),AKaterMatrix1msDX(:,4),'--r')
hold on
errorbar(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,3),AKaterMatrix1msDX(:,4),'--r')
The code for the second is:
[FitUp,goodnessUP] = fit(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,2),'poly1')
[FitDown,goodnessDOWN] = fit(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,3),'poly1')
plot(FitDown,'b')
hold on
plot(FitUp,'b')
hold on
errorbar(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,2),AKaterMatrix1msDX(:,4),'--r')
hold on
errorbar(AKaterMatrix1msDX(:,1),AKaterMatrix1msDX(:,3),AKaterMatrix1msDX(:,4),'--r')
Here you can find the two fits, it appears that the first fit is not cropped, while the second after the hold on
is:
https://docs.google.com/file/d/0B749BCu7mnZHaEhITUZ1YzdfVDA/edit?usp=sharing
https://docs.google.com/file/d/0B749BCu7mnZHeDVTOGRuSkktUmc/edit?usp=sharing