How can i calculate error (sse) between 2 curves in one figure?

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.
Thank you for your time. Yes as you said the thick line comes from a fit to the data points (saved figure). The thin line comes from x and y data. I plottet the x and y data into the saved figure of the curvefit. now i wanted the difference or the space or error between the thick line and the thin line.
That's what the above gives if the points are commensurate.

Sign in to comment.

Answers (0)

Categories

Asked:

on 8 Nov 2013

Commented:

dpb
on 8 Nov 2013

Community Treasure Hunt

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

Start Hunting!