0% found this document useful (0 votes)
19 views1 page

Experiment 5 - Newton's Divided Difference

The document discusses a student's lab report on numerical analysis. It includes MATLAB code to apply Newton's divided difference formula to a set of data points to interpolate a value. The code defines the data points, calculates the divided differences, and uses the formula to interpolate f(0.9).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Experiment 5 - Newton's Divided Difference

The document discusses a student's lab report on numerical analysis. It includes MATLAB code to apply Newton's divided difference formula to a set of data points to interpolate a value. The code defines the data points, calculates the divided differences, and uses the formula to interpolate f(0.9).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

BEST

National University of Technology, Islamabad


Department of Mechanical Engineering
Course Code: ME3506 Course Name: Numerical Analysis Lab
Batch: 2020 Semester: Fall 2022
Instructor: Dr. Ubaid Ahmed Nisar Max Marks: 25

LAB REPORT 05

Student Name: Aashir Ali Khan Registration No: F20602033

Question No: 01 Newton’s Divided Difference


clc
clear all
format long
x0 = 0.6;
x1 = 0.7;
x2 = 0.8;
x3 = 1.0;
xp = 0.9;
fx0 = -0.17694460;
fx1 = 0.01375227;
fx2 = 0.22363362;
fx3 = 0.65809197;

MATLAB CODE fx01=(fx1-fx0)/(x1-x0);


fx12=(fx2-fx1)/(x2-x1);
fx23=(fx3-fx2)/(x3-x2);

fx012=(fx12-fx01)/(x2-x0);
fx123=(fx23-fx12)/(x3-x1);

fx0123=(fx012-fx123)/(x3-x0);

fv = fx0 + (0.9 - x0) * fx01 + (0.9 - x0) * (0.9 - x1)*


fx012 + (0.9 - x0) * (0.9 - x1) * (0.9 - x2) * fx0123;

fprintf('The value of f(0.9) with Newton Divided Difference


Formula is %f\n', fv);

Output:

You might also like