Newton's Interpolating Divided Difference Polynomial (MATLAB)Divided difference coefficient of product of two functionsSimple Polynomial Interpolation ProblemIterative Scheme-Programming MatlabWhat is the physical meaning of 2 nodes being same while fitting an interpolating polynomial?Average of two Newton's forward-difference polynomials gives Stirling formulaConstructing a 2 fold oversampled cosine basis in MATLABHelp with Legendre Plot MatlabHow to import a sequence of files into a cell in matlab?Formulating a linear difference equation model and some MatLab tipsNewton's Method and Aitken's Method Convergence
If Captain Marvel (MCU) were to have a child with a human male, would the child be human or Kree?
ContourPlot — How do I color by contour curvature?
Make a Bowl of Alphabet Soup
Possible Eco thriller, man invents a device to remove rain from glass
Is there anyway, I can have two passwords for my wi-fi
Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?
Given this phrasing in the lease, when should I pay my rent?
How to make a list of partial sums using forEach
Confusion over Hunter with Crossbow Expert and Giant Killer
Grepping string, but include all non-blank lines following each grep match
If A is dense in Q, then it must be dense in R.
Air travel with refrigerated insulin
Proving an identity involving cross products and coplanar vectors
How do you justify more code being written by following clean code practices?
Should I warn a new PhD Student?
Why is participating in the European Parliamentary elections used as a threat?
Unable to disable Microsoft Store in domain environment
"Oh no!" in Latin
How much do grades matter for a future academia position?
In One Punch Man, is King actually weak?
Review your own paper in Mathematics
How to test the sharpness of a knife?
Do I have to take mana from my deck or hand when tapping a dual land?
Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?
Newton's Interpolating Divided Difference Polynomial (MATLAB)
Divided difference coefficient of product of two functionsSimple Polynomial Interpolation ProblemIterative Scheme-Programming MatlabWhat is the physical meaning of 2 nodes being same while fitting an interpolating polynomial?Average of two Newton's forward-difference polynomials gives Stirling formulaConstructing a 2 fold oversampled cosine basis in MATLABHelp with Legendre Plot MatlabHow to import a sequence of files into a cell in matlab?Formulating a linear difference equation model and some MatLab tipsNewton's Method and Aitken's Method Convergence
$begingroup$
I'm trying to construct a polynomial in MATLAB using Newton's Interpolating Divided Difference Formula, and in doing so, generalize it to any size vector x and y. So far i was able to obtain the coefficients for the polynomial, but i'm unsure how to construct the polynomial itself. Here's what i've done so far:
%% Divided Difference Generalization
% Example:
% Construct a Divided Difference Table for x0=2, x1=-1, x2=-6 and
% f(x)=x^2+4x-5
% x | 0th DD | 1'st DD | 2nd DD |
% 2 | 7 | | |
% -1 | -8 | -5 | |
% -6 | 7 | -3 | 1 |
x=[2 -1 -6];
y=[7 -8 7];
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength)
D(:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D);
I'm trying to construct a general polynomial from the coefficents i've obtained from a to become:
begineqnarray
P_2(x) &&=&& 7+5(x-2)+1(x-2)(x+1)\
&&=&& x^2+4x-5
endeqnarray
And have it work for any number of points.
I'd appreciate any tips or help on to how to construct these polynomials without actually having to hardcode them. Thank you.
numerical-methods matlab
$endgroup$
add a comment |
$begingroup$
I'm trying to construct a polynomial in MATLAB using Newton's Interpolating Divided Difference Formula, and in doing so, generalize it to any size vector x and y. So far i was able to obtain the coefficients for the polynomial, but i'm unsure how to construct the polynomial itself. Here's what i've done so far:
%% Divided Difference Generalization
% Example:
% Construct a Divided Difference Table for x0=2, x1=-1, x2=-6 and
% f(x)=x^2+4x-5
% x | 0th DD | 1'st DD | 2nd DD |
% 2 | 7 | | |
% -1 | -8 | -5 | |
% -6 | 7 | -3 | 1 |
x=[2 -1 -6];
y=[7 -8 7];
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength)
D(:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D);
I'm trying to construct a general polynomial from the coefficents i've obtained from a to become:
begineqnarray
P_2(x) &&=&& 7+5(x-2)+1(x-2)(x+1)\
&&=&& x^2+4x-5
endeqnarray
And have it work for any number of points.
I'd appreciate any tips or help on to how to construct these polynomials without actually having to hardcode them. Thank you.
numerical-methods matlab
$endgroup$
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27
add a comment |
$begingroup$
I'm trying to construct a polynomial in MATLAB using Newton's Interpolating Divided Difference Formula, and in doing so, generalize it to any size vector x and y. So far i was able to obtain the coefficients for the polynomial, but i'm unsure how to construct the polynomial itself. Here's what i've done so far:
%% Divided Difference Generalization
% Example:
% Construct a Divided Difference Table for x0=2, x1=-1, x2=-6 and
% f(x)=x^2+4x-5
% x | 0th DD | 1'st DD | 2nd DD |
% 2 | 7 | | |
% -1 | -8 | -5 | |
% -6 | 7 | -3 | 1 |
x=[2 -1 -6];
y=[7 -8 7];
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength)
D(:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D);
I'm trying to construct a general polynomial from the coefficents i've obtained from a to become:
begineqnarray
P_2(x) &&=&& 7+5(x-2)+1(x-2)(x+1)\
&&=&& x^2+4x-5
endeqnarray
And have it work for any number of points.
I'd appreciate any tips or help on to how to construct these polynomials without actually having to hardcode them. Thank you.
numerical-methods matlab
$endgroup$
I'm trying to construct a polynomial in MATLAB using Newton's Interpolating Divided Difference Formula, and in doing so, generalize it to any size vector x and y. So far i was able to obtain the coefficients for the polynomial, but i'm unsure how to construct the polynomial itself. Here's what i've done so far:
%% Divided Difference Generalization
% Example:
% Construct a Divided Difference Table for x0=2, x1=-1, x2=-6 and
% f(x)=x^2+4x-5
% x | 0th DD | 1'st DD | 2nd DD |
% 2 | 7 | | |
% -1 | -8 | -5 | |
% -6 | 7 | -3 | 1 |
x=[2 -1 -6];
y=[7 -8 7];
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength)
D(:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D);
I'm trying to construct a general polynomial from the coefficents i've obtained from a to become:
begineqnarray
P_2(x) &&=&& 7+5(x-2)+1(x-2)(x+1)\
&&=&& x^2+4x-5
endeqnarray
And have it work for any number of points.
I'd appreciate any tips or help on to how to construct these polynomials without actually having to hardcode them. Thank you.
numerical-methods matlab
numerical-methods matlab
asked Mar 14 at 5:04
Mister_JMister_J
9615
9615
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27
add a comment |
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3147581%2fnewtons-interpolating-divided-difference-polynomial-matlab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3147581%2fnewtons-interpolating-divided-difference-polynomial-matlab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Your first step is to study and code Horner's method for polynomials given in the standard basis. Afterwards you should extend Horner's method to polynomials given in Newton's form.
$endgroup$
– Carl Christian
Mar 15 at 20:27