Contents
Aaron Klapheck
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 18-Mar-2008 14:53:19
Notes
1. line fit exponential
clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('% %')
disp('% Purpose: line fit an exponential %')
disp('% Programer: Aaron Klapheck %')
disp('% %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
load capacitor.dat
t = capacitor(:,1);
v = capacitor(:,2);
ct = linefit(t, log(v));
c = [exp(ct(2)); ct(1)]
y_new = c(1).*exp(c(2).*t)
plot(t,v,'o', t, y_new)
The date and time: 18-Mar-2008 14:53:19
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Purpose: line fit an exponential %
% Programer: Aaron Klapheck %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c =
5.0000
-10.0000
y_new =
5.0000
4.0936
3.3516
2.7441
2.2466
1.8394
1.5060
1.2330
1.0095
0.8265
0.6767
0.5540
0.4536
0.3714
0.3041
0.2489
1. line fit power
clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('% %')
disp('% Purpose: line fit an power %')
disp('% Programer: Aaron Klapheck %')
disp('% %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
load capacitor.dat
y = [2.2361, 10.9329, 24.6765, 42.8382, 65.0486];
x = [1, 2.5, 4, 5.5, 7];
cx = linefit(log(x), log(y));
c = [exp(cx(2)); cx(1)]
y_new = c(1).*x.^c(2)
plot(x, y,'o', x, y_new)
The date and time: 18-Mar-2008 14:53:20
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Purpose: line fit an power %
% Programer: Aaron Klapheck %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c =
2.2361
1.7320
y_new =
2.2361 10.9330 24.6765 42.8381 65.0484