 Numerical Analysis Questions

Subject Mathematics Numerical Analysis

Question

Check the file: Questions.pdf

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

4.

a.
function weights = barywghts(x)
X = repmat(x(:), [1 numel(x)]);
xi = reshape(X(~eye(size(X))),size(X,1),size(X,2)-1);
xj = X(:,1:end-1);
weights = 1./prod(xj - xi, 2);
end

b.
function p = baryinterp(x,f,t)
x = x(:);
t = t(:);
f = f(:);

m = numel(t);
w = barywghts(x);
p = zeros(size(t));

for i=1:m
interpPt = t(i) == x;
if any(interpPt)
temp = f(interpPt);
p(i) = temp(1);
else
deno = sum(w./(t(i)-x),1);
nume = sum((w.*f)./(t(i)-x),1);
p(i) = nume/deno;
end
end
end...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Related Homework Solutions

Numerical Analysis \$3.00
Mathematics
Numerical Analysis
Problems
Jacobi
Gauss-Seidel
Formula
Numerical Analysis Questions \$60.00
Numerical Analysis
Mathematics
Computer Science
Graphs
Cost Factors
Compressive Stress
Matlab
Optimization
Documents
Cells
Equations
Functions
Variables
Tables
Numerical Analysis MATLAB Questions \$33.00
Numerical
Analysis
MATLAB
Ordinary
Differential
Equations
Euler
Runge-Kutta
Scheme
Convergance
Lagrange Numerical Analysis Questions \$35.00
Mathematics
Numerical Analysis
Lagrange
Polynomial
Water
Liter
Measurement
Value
Data
Numerical Analysis Questions \$8.00
Numerical Analysis
Functions
Polynomials
Proofs
Theorems
Functions
Points
Symmetry
Constants
Statements
Sums
Numerical Methods \$50.00
Mathematics
Numerical Methods
Matlab