%Input - f is the object function
% - df is the derivative of f input as a string 'df'
% - p0 is the initial approximation to a zero of f
% - delta is the tolerance for p0
% - epsilon is the tolerance for the function values y
% - max1 is the maximum number of iterations
%Output - p is the Steffensen approximation to the zero
% - Q is the matrix containing the Steffensen sequence
%If f and df are defined as M-file functions use the @ notation
% call [p,Q]=steff(@f,@df,p0,delta,epsilon,max1).
%If f and df are defined as anonymous functions use the
% call [p,Q]=steff(f,df,p0,delta,epsilon,max1).
% NUMERICAL METHODS: Matlab Programs
% (c) 2004 by John H. Mathews and Kurtis D. Fink
% Complementary Software to accompany the textbook:
% NUMERICAL METHODS: Using Matlab, Fourth Edition
% ISBN: 0-13-065248-2
% Prentice-Hall Pub. Inc.
% One Lake Street
% Upper Saddle River, NJ 07458
%Initialize the matrix R
%Denominator in Newton-Raphson method is calculated
%Conditional calculates Newton-Raphson approximations
'division by zero in Newton-Raphson method'
%Denominator in Aitkens Acceleration process is calculated
%Conditional calculates Aitkens Acceleration approximations
'division by zero in Aitkens Acceleration'
%Breaks out and ends program if division by zero occured
%Stopping criteria are evaluated; p and the matrix Q are determined