{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

14-440-127 Recitation 11 Problems- Solutions

14-440-127 Recitation 11 Problems- Solutions - 14:440:127...

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

View Full Document Right Arrow Icon
14:440:127- Introduction to Computers for Engineers Problems for students to attempt in Recitation 11. 1) Given the following points, linearly interpolate to find the values at x=12.4, 13.6, and 14.7 X = 10:15; Y = [21 21.8 25.3 26 27.8 30.3]; X = 10:15; Y = [21 21.8 25.3 26 27.8 30.3]; newy = interp1(X,Y, [12.4 13.6 14.7] ) 2) Given the following points, calculate cubic splines to interpolate between these points, and then graph the originals (as X’s) and the splines on the same graph: X = 10:15; Y = [21 15 25.3 35 27.8 30.3]; X = 10:15; Y = [21 15 25.3 35 27.8 30.3]; newx = 10:0.01:15; %% if the interval is too big, it won't graph as a curve %%% because you'll only have a couple of points for the new y’s, %%% and matlab will connect them with lines %%% when you have lots of points, matlab still connects each set of points with lines %%% but they’re so close together, you can’t tell newy = spline(X,Y,newx); plot(X,Y, 'X' ,newx,newy) 3) Find the equation of the line that best fits the following data points using least squares regression: X = 10:15; Y = [21 21.8 25.3 26 27.8 30.3]; X = 10:15; Y = [21 21.8 25.3 26 27.8 30.3]; coefs = polyfit(X,Y,1); coefs = (round(coefs*100)/100); %%% round to 2 decimal places disp(poly2sym(coefs)) 4) Find the equation of the 3 rd degree polynomial that best fits the following data points using least squares regression: X = 10:15; Y = [1794 2454 3224 4259 5227 6438]; X = 10:15; Y = [1794 2454 3224 4259 5227 6438]; coefs = polyfit(X,Y,3); disp(coefs) %% converting to symbolic was kind of ugly 5) Find an equation for the following set of data. (Hint: plot on semilogy and loglog axes first, and then perform an appropriate linearization).
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ 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