Contents

Aaron Klapheck

% In class 6-Mar-08
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 10-Apr-2008 08:53:07 

Notes

% Curve fitting data.
%
% Reading Ch. 9
%   Introduction: pg 455 to 456.
%   9.1.5 on page 468
%
% xfit = [2:0.01:20], called x-grid.
% yfit = c_1*exp(c_2*x)
%
% residuals: y distance between actual data and curve approximation.
%
% polyfit(x,y,n)
% where n is the degree of the polynomial
%
% z = polyfit(x,y,n)
% p = a_(n)*x^n + a_(n-1)*x^(n-1) + .... a_(0)*x^0.
% z(1) = a_(n)
% z(2) = a_(n-1)
% z(n) = a_(0)
%
% See homework problem 8 on page 512.
%
% 2x^5 + 3x^3 + 1
% polyfit gives:  2x^5 + 0.335E-9x^4 + 3x^3 + 5.3E-12x + 1
% If some of the coefficients are almost zero then they basically arn't
% needed.
%
% expect us to do:
% Loops i.e. if ... else and for ... end
%
%
% Test 2 on week 8
%   must have WebCT and saclink account
%   1. for loops
%   2. conditional statements
%       if - else ... else - end
%       switch (controller) case{..} case{..} otherwise - end
%   3. Solve systems of equations (Gauss)
%   4. Read/write data files
%   5. extract matrix from systems of equations and vice-versa
%   6. Use Graphical method to solve a 3x3 system  (Graph)
%   7. Curve-fitting
%       a) straight line
%       b) exponential
%       c) Power function
%       d) polyfit/polyval
%   8. User-defined functions
%       a) include heading 1 line
%   9. Interpolation
%   10. Relative error
%       a) absolute error: (true value) - (calculated value)
%       b) relative error: (absolute error)/(true value)*100
%
%   Note: should use moduals to do each of these things. Open book open
%   note.
%