Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Heres what I got so far. Im pretty sure I didn't follow instructions correctly by using one For loop per function. These are the issues

image text in transcribed

Heres what I got so far. Im pretty sure I didn't follow instructions correctly by using one "For loop" per function.

image text in transcribedimage text in transcribedThese are the issues I am running into

image text in transcribedPlease use MATLAB, Thank You!

Newton's polynomials For this test, you need to write two functions: polyNewton (X,Y) and interpNewton (a,X,x). X and Y=f(X) are vectors which contains the values to be interpolated. The first function returns the coefficients of the Newton's polynomial The second uses the output of the first and X to calculate the interpolated values at points contained in x. The twist is that you are allowed one and only ONE for loop in each function AND you are not allowed to allocate any extra memory aside from a, which stores the output in polyNewton, and y which stores the output in interpNewton (the dummy index in the for loop does not count against memory allocation). a=zeros(size (Y)); for i=2:n for j=n:1:i end end Previous Assessment: 2 of 4 Tests Passed Check for polyNewton Check for interpNewton Evaluated code is correct: Newton's coefficients Variable a has an incorrect value. The calculated coefficients are incorrect Evaluated code is correct: interpolated values Variable y has an incorrect value. The interpolated values are not correct. Newton's polynomials For this test, you need to write two functions: polyNewton (X,Y) and interpNewton (a,X,x). X and Y=f(X) are vectors which contains the values to be interpolated. The first function returns the coefficients of the Newton's polynomial The second uses the output of the first and X to calculate the interpolated values at points contained in x. The twist is that you are allowed one and only ONE for loop in each function AND you are not allowed to allocate any extra memory aside from a, which stores the output in polyNewton, and y which stores the output in interpNewton (the dummy index in the for loop does not count against memory allocation). a=zeros(size (Y)); for i=2:n for j=n:1:i end end Previous Assessment: 2 of 4 Tests Passed Check for polyNewton Check for interpNewton Evaluated code is correct: Newton's coefficients Variable a has an incorrect value. The calculated coefficients are incorrect Evaluated code is correct: interpolated values Variable y has an incorrect value. The interpolated values are not correct

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions