Matlab2 - Part I x =[1928 1932 1936 1948 1952 1956 1964...

Info icon This preview shows pages 1–2. Sign up to view the full content.

September 22, 2015 Part I x = [1928 1932 1936 1948 1952 1956 1964 1968 1972 1976 1980 1984 1988 1992 1996 2000 2004]; y = [12.2 11.9 11.5 11.9 11.5 11.5 11.4 11.08 11.07 11.08 11.06 10.97 10.54 10.82 10.94 10.75 10.93]; plot(x,y) xlabel( 'Year' ) ylabel( 'Finishing Time(sec)' ) title( 'Curve Fitting Exercise' ) Fit1=polyfit(x,y,1); y1=polyval(Fit1,x) RMS=(mean((y-y1).^2))^0.5 hold on ; plot(x,y1, 'r' ) plot(1960,11.0, 'gd' ) legend( 'original Data' , 'Fit1' , 'plot' ) B. Fit1=-0.0185, 47.6837 C. RMS=0.1691 E. The line does not accurately reflect that value. The best fit line is about 0.4 about the point on the y- axis. The error is about double the RMS error F. I predict that the finish time will be about 10.7 seconds. My prediction based off of the best fit line is about 0.23 seconds off from the actual time. It’s close to the RMS error.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Part II hold on ; plot(xvals,yvals); xlabel( 'xvals' ) ylabel( 'yvals' ) title( 'Curve Fitting Exercise Part II' ) Fit1=polyfit(xvals,yvals,1); y1=polyval(Fit1,xvals); hold on ; plot(xvals,y1, 'g--' ) RMS=(mean((yvals-y1).^2))^0.5; %RMS=13.7048 %Fit1=[11.0086,1.2999] Fit2=polyfit(xvals,yvals,2); y2=polyval(Fit2,xvals); plot(xvals,y2, 'b.' ); RMS2=(mean((yvals-y2).^2))^0.5; %RMS2=13.6202 %Fit2=[-0.1999,11.0086,2.9999] Fit3=polyfit(xvals,yvals,3); y3=polyval(Fit3,xvals); plot(xvals,y3, 'rd' ); RMS3=(mean((yvals-y3).^2))^0.5; %RMS3=2.0896-14 %Fit2=[0.6999,-0.1999,0.3000,2.9999 legend( 'original Data' , 'Fit1' , 'Fit2' , 'Fit3' ) RMS=13.7048 Fit1=[11.0086,1.2999] RMS2=13.6202 Fit2=[-0.1999,11.0086,2.9999] RMS3=2.0896-14 Fit2=[0.6999,-0.1999,0.3000,2.9999...
View Full Document

  • Spring '08
  • White
  • January 1, October 12, March 4, September 22, June 28

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern