Contents

Aaron Klapheck

% In class 11-Mar-08
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 18-Mar-2008 14:54:02 

Notes

% Posted sample test 2 on web CT.
% Should write data to a file not the screen.
%
%
% Interpolation
%   Use to find intermediate values with the range of data provided.
%   Matlab's build-in function "interp1" will be used. Finds the y-vales
%   inbetween the given y-values.
%       This function is used when the x-array is monotonically increasing
%       or decreasing. y values don't matter!
%       Ex: x = 2, 4, 6, 7, 8, 10 (works)
%       Ex: x = 3, 1, -3, -4, -10 (works)
%       Ex: x = 3, 23, -3, 5, 9, -2 (doesn't work)
%
% Practice line fit on page 468 and poly fit commands.
%
%

1. Interpolation

clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))

disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%                                                                %')
disp('%                    Purpose: Interpolation                      %')
disp('%                    Programer: Aaron Klapheck                   %')
disp('%                                                                %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')

% [numeric, txt] = xlsread('Interpolationdata.xls')
numeric = [2, 8; 4, 9; 7, 12; 10, 8]
x = numeric(:, 1)
y = numeric(:, 2)
Interpolation(x, y)
The date and time: 18-Mar-2008 14:54:02 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                %
%                    Purpose: Interpolation                      %
%                    Programer: Aaron Klapheck                   %
%                                                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

numeric =

     2     8
     4     9
     7    12
    10     8


x =

     2
     4
     7
    10


y =

     8
     9
    12
     8

********* INTERPOLATION  ********* 

	 Intermediate x 	 fi via linear 	 fi via spline 
	 ______________________________________________________
	     3.0000 		    8.5000 	    8.1556 
	 ______________________________________________________
	     5.5000 		   10.5000 	   10.7563 
	 ______________________________________________________
	     8.5000 		   10.0000 	   11.4938 
	 ______________________________________________________
%%%%%% THE END %%%%%% THE END %%%%%% THE END %%%%%