how to compare two graph plots and calculate error ?

I have to graph plots (ellipse) one was calculated and drawn using linear interpolation, I want to calculate the error between the two graphs in matlab. how can i do that??

5 Kommentare

BAN
BAN am 24 Sep. 2015
Can you please explain your problem !!
ok, so i have equations for an ellipse x=30*cost and y=15*sint. I use the equations with 100 data points and made an ellipse (linear interpolation, since I am working under the assumption that machine cant use higher polynomials). so now i want to compare the two graphs (one that i got with 100 points and the other one if the equations are regularly drawn) and calculate the error.
>> s=pi/180; %to make radians. i=1:100; %for 100 data points t=3.6*s*i; %360 degree in to radians x=30*cos(t); %parametric equation y=15*sin(t); %parametric equation plot(x,y) >> >> plot(x,y) >> c=linspace(0,2*pi); >> a=30*cos(c); >> b=15*sin(C); Undefined function or variable 'C'.
Did you mean: >> b=15*sin(c); >> plot(a,b) >> plot(x,y,a,b) a and b are the points on the ellipse and x and y are the interpolated values of ellipse using 100 points i want to calculate the difference or error between the two
this is the code

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 24 Sep. 2015

Kommentiert:

am 24 Sep. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by