Question
Hello, I am struggling with writing the Matlab code for the problem statement posted below, any help that can be provided would be greatly appreciated.
Hello, I am struggling with writing the Matlab code for the problem statement posted below, any help that can be provided would be greatly appreciated. Thank you
Problem Statement:
Write an algorithm for calculating coefficients of the Newtons interpolating polynomial function for a given discrete data set. This specific problem will demonstrate the case that a more number of given data may result in poor curve fitting when the data are in fact from a smooth curve. Submit your m-file and the figure.
Write an algorithm that interpolates given data points using the Newtons interpolating polynomial. Your algorithm must be a function that takes data points as inputs and outputs the coefficients via completing the divided-difference table.
Using the above algorithm, fit the following two data sets and plot the results in a single figure plotting Data 1 in blue circle, the corresponding interpolating polynomial for Data 1 in black line, Data 2 in red triangle, and the corresponding interpolating polynomial for Data 2 in black dashed line.
Data set 1: x = [1, 0.5, 0, 0.5, 1] f(x) = [0.0385, 0.1379, 1.0000, 0.1379, 0.0385]
Data set 2: x = [1, 0.75. 0.5, 0.25, 0, 0.25, 0.5, 0.75, 1] f(x) = [0.0385, 0.0644, 0.1380, 0.3902, 1.0000, 0.3902, 0.1380, 0.0644, 0.0385]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started