How can i calculate error (sse) between 2 curves in one figure?
Show older comments
Hi, I saved a plot V60abX1ohneGrid.fig. I have some x and y data. I plot the x and y data into V60abX1ohneGrid.fig like this:
x; y; fig1=openfig('V60abX1ohneGrid.fig'); plot(gca,x,y)
So i get this plot

Can someone tell me how i get the error (maybe SSE) between the 2 curves?
Thanks
3 Comments
What is the second curve? I see from the legend the curve fit and the data points look reasonable wrt to each other, the other thin line I don't know about.
Anyway, that aside if you don't have the data then you can retrieve it from the xdata, ydata properties of the lines of the plot. If the data points are commensurate with the x-values between the two then
d=y1-y2;
SSE=dot(d,d);
If they don't have the same x positions or are of different lengths your choice is to either select the points that do, interpolate to some common set of points or the like.
dpb
on 8 Nov 2013
That's what the above gives if the points are commensurate.
Answers (0)
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!