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

BAN
BAN 2015년 9월 24일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2015년 9월 24일

댓글:

2015년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by