Code covered by the BSD License
-
A=abm(f,T,Y)
-
D=qr1(A,epsilon)
Input - A is a symmetric tridiagona nxn matrix
-
D=qr2(A,epsilon)
Input - A is a symmetric tridiagonal nxn matrix
-
E=euler(f,a,b,ya,M)
-
F=findiff(p,q,r,a,b,alpha,bet...
-
H=hamming(f,T,Y)
-
H=heun(f,a,b,ya,M)
-
L=linsht(F1,F2,a,b,alpha,beta...
Input - F1 and F2 are the systems of first-order equations
-
L=ls(F1,F2,a,b,alpha,beta,M)
Input - F1 and F2 are the systems of first-order equations
-
M=milne(f,T,Y)
-
P=pcsfit(X,S)
-
R=rk4(f,a,b,ya,M)
-
R=rkf45(f,a,b,ya,M,tol)
-
S=csfit(X,Y,dx0,dxn)
-
T4=taylor(df,a,b,ya,M)
-
T=house (A)
Input - A is an nxn symmetric matrix
-
T=rctrap(f,a,b,n)
-
U=crnich(f,c1,c2,a,b,c,n,m)
-
U=dirich(f1,f2,f3,f4,a,b,h,to...
Input - f1,f2,f3,f4 are boundary functions input as strings
-
U=forwdif(f,c1,c2,a,b,c,n,m)
-
X=backsub(A,B)
Input - A is an n x n upper-triangular nonsingular matrix
-
X=gseid(A,B,P,delta, max1)
-
X=jacobi(A,B,P,delta, max1)
-
X=trisys (A,D,C,B)
Input - A is the sub diagonal of the coefficient matrix
-
Z=srule(f,a0,b0,tol0)
-
[A,B]=lsline(X,Y)
Input - X is the 1xn abscissa vector
-
[A,B]=tpcoeff(X,Y,M)
-
[A,df]=diffnew(X,Y)
-
[C,D]=newpoly(X,Y)
Input - X is a vector that contains a list of abscissas
-
[C,L]=lagran(X,Y)
Input - X is a vector that contains a list of abscissas
-
[C,X,Y]=cheby(fun,n,a,b)
Input - fun is the string function to be approximated
-
[D,err,relerr,n]=diffext(f,x,...
-
[L,n]=difflim(f,x,toler)
-
[P,iter,err]=newdim(F,JF,P,de...
Input-F is the system saved as the M-file F.m
-
[P0,y0,err,P]=grads(F,G,P0,ma...
-
[R,quad,err,h]=romber(f,a,b,n...
-
[S,E,G]=golden(f,a,b,delta,ep...
-
[SRmat,quad,err]=adapt(f,a,b,...
-
[T,Z]=rks4(F,a,b,Za, M)
-
[V,D]=jacobi1(A,epsilon)
-
[V0,y0,dV,dy]=nelder(F,V,min1...
-
[c,err,yc]=bisect(f,a,b,delta)
-
[c,err,yc]=regula(f,a,b,delta...
-
[lambda,V]=invpow(A,X,alpha,e...
-
[p,Q]=steff(f,df,p0,delta,eps...
-
[p,y,err]=muller(f,p0,p1,p2,d...
-
[p0,err,k,y]=newton(f,df,p0,d...
-
[p1,err,k,y]=secant(f,p0,p1,d...
-
approot (X,epsilon)
Input - f is object function saved as an M-file named f.m
-
finedif(f,g,a,b,c,n,m)
-
fixedpoint(g,p0,tol,max1)
-
fixpt(g,p0,tol,max1)
Input - g is the iteration function
-
g(x)
-
lspoly(X,Y,M)
-
lufact(A,B)
-
power(A,X,epsilon,max1)
NUMERICAL METHODS: MATLAB Programs
-
power1(A,X,epsilon,max1)
-
quad=gauss(f,a,b,A,W)
-
quadmin(f,a,b,delta,epsilon)
-
s=simprl(f,a,b,M)
-
s=traprl(f,a,b,M)
-
seidel(G,P,delta, max1)
-
sroot(a)
-
uptrbk(A,B)
-
z=tp(A,B,x,M)
-
readme.m
-
View all files
|
|
| [A,df]=diffnew(X,Y) |
function [A,df]=diffnew(X,Y)
%Input - X is the 1xn abscissa vector
% - Y is the 1xn ordinate vector
%Output - A is the 1xn vector containing the coefficients of the Nth
% degree Newton polynomial
% - df is the approximate derivative
% NUMERICAL METHODS: MATLAB Programs
%(c) 1999 by John H. Mathews and Kurtis D. Fink
%To accompany the textbook:
%NUMERICAL METHODS Using MATLAB,
%by John H. Mathews and Kurtis D. Fink
%ISBN 0-13-270042-5, (c) 1999
%PRENTICE HALL, INC.
%Upper Saddle River, NJ 07458
A=Y;
N=length(X);
for j=2:N
for k=N:-1:j
A(k)=(A(k)-A(k-1))/(X(k)-X(k-j+1));
end
end
x0=X(1);
df=A(2);
prod=1;
n1=length(A)-1;
for k=2:n1
prod=prod*(x0-X(k));
df=df+prod*A(k+1);
end
|
|
Contact us at files@mathworks.com