%%%%%
e =2.7183

A=[1 1/2;1/2 1/3]

b=[e-1;1]

alfa=A\b;
a1=alfa(1)
a2=alfa(2)

x=0:.1:1;
for i=1:length(x)
y(i)=e^(x(i));
end

figure('Color',[1 1 1])
plot(x,y,'b')
hold on

g=a1+a2*x;
plot(x,g,'r')


%%%
close all
clc
clear all
% Ajuste linear g(x)=a0+b0x
x=[0.342422680822206	0.4314	0.5441	0.6128]
y=[1.8129	1.7782	1.7243	1.699]
plot(x,y,'*')
a0=1.96107989918115
b0=-0.429914342817723
hold on
i=0.3:0.1:0.7
j=a0+b0*i
plot(i,j)

%%%%%
close all
clc
clear all
% Ajuste não-linear g(t)=at^b
t=[2.2 2.7 3.5 4.1];
s=[65 60 53 50];
a=91.83;
b=-0.4299;
% s(t)=at^b
plot(t,s,'*')
hold on
tx=min(t):0.01:max(t);
for i=1:length(tx)
   g(i)=a*(tx(i))^b;
end
plot(tx,g)

%%%%%%%%%%%%%%%%%%
%Ajuste não-linear g(t)=ae^(tb)
% t=[ e e^2 e^3 e^4 ]
% s=[ 1 2 4 8 ]
%s(t)=a0e^(b0t)
close all
a0=0.28975166704191;
b0=0.0353796456559632;

e=exp(1);
t=[e e^2 e^3 e^4];
s=[1 2 4 8];
plot(t,s,'*')
hold on
tx=min(t):0.01:max(t);
for i=1:length(tx)
    g(i)=(e^a0)*e^(b0*(tx(i)));
end
plot(tx,g)

%%%%%%%%%%%%%%%%%%
% t=[ 1 2 4 8 ]
% s=[ e e^2 e^3 e^4 ]
%s(t)=a0e^(b0t)
clc
clear all
close all
a0=1;
b0=0.4;

e=exp(1);
t=[1 2 4 8];
s=[e e^2 e^3 e^4];
plot(t,s,'*')
hold on
tx=min(t):0.01:max(t);
for i=1:length(tx)
    g(i)=(e^a0)*e^(b0*(tx(i)));
end
plot(tx,g)

