Applied Numerical Methods with MATLAB for Engineers and Scientists(4th Edition) Summary: Please resolveProblem 17.24 inmatlab using Newton's interpolation: 1) Create a blank excel file, and copy the...

Applied Numerical Methods with MATLAB for Engineers and Scientists(4th Edition)
Summary:

Please resolveProblem 17.24 inmatlab using Newton's interpolation:


1) Create a blank excel file, and copy the table given in the problem statement into it.


2) Use the Matlab xlsread command to read the data into matlab from the excel file:



https://www.mathworks.com/help/matlab/ref/xlsread.html#mw_2b66895a-270a-4fe2-aeda-ee9d833839a2


3) Write a subroutine that performs the two interpolations by programming either the Newton or Lagrange formulas into matlab. Below are the requirements for the subroutine:



  • It should accept either 2 or 3 sets of (x,y) coordinates. In order to allow your subroutine to accept avariablenumber of inputs, you should use these commands:



https://www.mathworks.com/help/matlab/ref/varargin.html



https://www.mathworks.com/help/matlab/ref/nargin.html


also see this example



http://matlab.izmiran.ru/help/techdoc/matlab_prog/ch05_m17.html




  • If your subroutine receives 2 sets, then it should usefirstorderinterpolation; but if it receives 3 sets of data, it should usesecond orderinterpolation.


You can choose the method that you like more (Newton or Lagrange), and use the equations for the first and second order directly: eqns 17.5 and 17.6 OR 17.20 and 17.21


If it receives any other number of inputs, you should use the 'error' command to tell the user how many inputs were received




  • once the interpolated value obtained, it should bepassed outof the subroutine


4) Use the matlab interpolation command to verify that your answers are correct:https://www.mathworks.com/help/matlab/ref/interp1.html


5) Use the xlxswrite command to write your results a different sheet in the same Excel file:https://www.mathworks.com/help/matlab/ref/xlswrite.html


6) For each of the two interpolation methods, plot the data points and the interpolated point (which should use a different symbol) in a figure. Make sure to give titles to the axes, and use a legend to differentiate between the data and the two interpolation method results.



Apr 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here