Skip to main content

Numerical Computing using Matlab Homework Solution

Page 1

Numerical Computing using Matlab Homework Solution The homework was to solve the following exercises using Matlab. Students were allowed to summarize the answers by hand. • Section 1.2, #34 • Section 1.4, #40, 42 • Section 1.7, #41, 43 Here are the solutions: 1.2.34 We want to find an interpolating polynomial between velocity (V) and force (F), then evaluate that polynomial when the velocity is 7.5. Here is the solution in Matlab: F=[0 2.9 14.8 39.6 74.3 119]’; A=[ones(6,1) V V.^2 V.^3 V.^4 V.^5] C=rref([A F]); %The last column is the vector of coefficients for the poly coefs=C(6:-1:1,end) %These are the coefficients for the polynomial % These commands will create points to plot (optional): cc=linspace(0,10); yy=polyval(coefs,cc); % Plot of the data and our curve plot(V,F,’r*’,cc,yy,’k-’); % Evaluate the polynomial at a velocity of 7.5: polyval(coefs,7.5) Visit: www.matlabassignmentexperts.com Email: info@matlabassignmentexperts.com WhatsApp: +1(315)557-6473


Turn static files into dynamic content formats.

Create a flipbook
Numerical Computing using Matlab Homework Solution by Matlab Assignment Experts - Issuu