Question

2. Write a question for Newton-divided difference interpolation. Then, solve it theoretically. After solving it, write a MATL
0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:-

clc%clears screen

clear all%closes history

close all%closes all files

format long

X= 0:0.2:1;

Y= exp(-X).*cos(X);

x=0:0.01:1;

y=newton_interp(X,Y,x)

plot(x,yX,Y'0');

function y= newton_interp(X,Y,x)

format long

a=x;

b=y;

%x=input('Enter x:');

[m,n]=size(a)

fx=0;

for l=1:n

%--------------calculating dividing diference-----------

s=0;

for i=1:l

p=1;

for k=1:l % Denomlnator part product

if(k~=j)

p=p*(a(j)-a(k));

end

end

s=s+b(J)/p;%summalation f(x)/product

end

%---------------------------------------------------------------------------------------

p=1;

for J=1:1-1%coefficlent part of f [...]

p=p.*(x-a(J)));

end

fx=fx+s.*p; %Polynomlal!

end

y=fx;

end

- A MATLAB R2018 HOME 5 x Pradeep - 0 X 56 Search Documentation E l View PLOTS Find Files 3 Compare - Print Figure 1 Eile Edi

thank u..

pleae give me thumb up..

Add a comment
Know the answer?
Add Answer to:
2. Write a question for Newton-divided difference interpolation. Then, solve it theoretically. After solving it, write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • U L e y aur ASIEN U Newtons Divided Difference Interpolation Question 2 Newtons Divided Engineering...

    U L e y aur ASIEN U Newtons Divided Difference Interpolation Question 2 Newtons Divided Engineering Math | Assignment Question 2. P Flag question Given the following data points, find the Newton's divided difference interpolating polynomial 2112 f(0) 211 Question 2.a. Tries remaining 2 What is the degree of the Newton's divided difference interpolating polynomial? Ans: (Integer input) Marked out of 4.00 Check P Flag question Question 2b. Tries remaining 2 asp/b, fraction should be in its simplest form) Fill...

  • er Lagrange ,Divided difference and Hermitewatnejed, Jnp 1.5, and x2-2, andf (x)ssin(x) * Given the point sx.-1, a) Find its Lagrange interpolation P on these points b) Write its newton's divi...

    er Lagrange ,Divided difference and Hermitewatnejed, Jnp 1.5, and x2-2, andf (x)ssin(x) * Given the point sx.-1, a) Find its Lagrange interpolation P on these points b) Write its newton's divided difference P, polynomial c)Write Hermite Hs by Using part a outcomes d) Write Hermite Hi by Using part b outcomes Rules: Lagrange form of Hermite polynomial of degre at most 2n-+1 Here, L., (r) denotes the Lagrange coefficient polynomial of degree n. If ec la.bl, then the error formula...

  • How do your write this in Matlab. Create a program that takes as input: An integer...

    How do your write this in Matlab. Create a program that takes as input: An integer nFunction that is either 1 or 2 indicating which of the two functions below to nsc * An integer n in [1.oc) indicating how many data points (ro."). ·The left endpoint a of an overall interval. (n泓) tote. The right endpoint b of an overall interval Your program should find the interpolating polynomial of degree less than or equal to of the requested function...

  • please write in python. thank you In this question you will be writing the code to...

    please write in python. thank you In this question you will be writing the code to carry out a query on a database table in Python. The CREATE command shown below is given just for your reference, so that you know the structure of the table and its columns. The database is an SQLite database in the file named taxa.sqlite. create table species ( id int primary key, genus varchar ( 5 0 ), species varchar(50), common_name char(100) ) Write...

  • Please help me with this question using Matlab language. Thank you. (7 pts 14 Write a function MyPolyMaker that takes in...

    Please help me with this question using Matlab language. Thank you. (7 pts 14 Write a function MyPolyMaker that takes in as arguments the coefficients for a polynomial of arbitrary degree. The function then returns a function handle that represents the desired polynomial. For example: MyPol k r (1,0,0) >> myfun _ myfun (2) ans wwwww 4 Remark The example above represents the polynomial 1x2+0x+0 MyPolyMake r (1,-1,1,-1,1) myfun myfun (2) ans ww 11 Remark The example above represents the...

  • C++ Question Polynomial Calculator (Will Rate All Answers) Hello, this question will be divided into many...

    C++ Question Polynomial Calculator (Will Rate All Answers) Hello, this question will be divided into many parts, this is the second part. Will quickly rate your answer! Thank you. First part is here : https://www.chegg.com/homework-help/questions-and-answers/c-question-polynomial-calculator-rate-answers-hello-question-divided-many-parts-s-first-pa-q39525382 This question has to do with operators and polynomials. - Scalar Polynomial Multiplication: const Polynomial operator* (const Polynomial& P, double z) The scalar multiplication P * z simply multiplies each coefficient in p with z as depicted in the following example: 0.5 (3.2x5 + 1.6x2...

  • A wind tunnel test conducted on an airfoil section yielded the following data between the lift...

    A wind tunnel test conducted on an airfoil section yielded the following data between the lift coefficient (CL) and the angle of attack (?): 12 1.40 16 1.71 20 1.38 de CL 0.11 0.55 0.95 You are required to develop a suitable polynomial relationship between ? and CL and fit a curve to the data points by the least-squares method using (a) hand calculations and (b) Matlab programming Hint: A quadratic equation (parabola) y(x)-aa,x +a x' can be used in...

  • Problem 1 Use the trapezoidal rule technique to approximate the following integrals: a) 「(x2+1)d...

    help wanted?? thank you explain correctly Problem 1 Use the trapezoidal rule technique to approximate the following integrals: a) 「(x2+1)dr(Note: use 0.5 increments forx) b) sina d INote: use a MATLAB function to subdivide the interval into eight equal parts) c e dx (Note: use 0.25 increments for x Problem 2 Use the Simpson's rule to evaluate the following integrals aDdr Problem 3: Given the polynomial: x3-6x2 + 30-0, Use MATLAB to find all roots of this polynomial. Use MATLAB's...

  • Question 2 We define, for a given integer m, 1 sism, h Xi = (i –...

    Question 2 We define, for a given integer m, 1 sism, h Xi = (i – 1) m-1' 1 X1 1 X2 The mx2 matrix X is defined as: X = 1 Xm [sin txi sin itx2 and the m X 1 vector Y is defined as: Y = 0.1 : [sin πm. = a) Create a function which for inputs m (a scalar) and v [v1; v2] (a column vector of 2x returns the scalar res given by res...

  • Long Question Q1: 25 points (1O points for part a, 15 points for part b). riate JavaSeript code t...

    Long Question Q1: 25 points (1O points for part a, 15 points for part b). riate JavaSeript code to deline a Point class Representing a) Provide the oints in 3 dimensions with an s, y, and z coordinate. A Point object should have the following mher), Returns the Euelidean distance to another instance of Point passed in as the points rameter other : Returns a new Point object with the same x. y, and z coordinates Additionally, your code should...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT