Rectilinear y MX+C Log-Log y B X M. Semilog y B (10) MX
Rectilinear y MX+C Log-Log y B X M. Semilog y B (10) MX
rectilinear= y=mx+c
log-log = y = b*x^m.
semilog=y=b(10)mx
x = 25:5:45;
p = polyfit(x,y,1) ;
xp= 0:1:45;
yp=53.5*xp - 1354.5 ;
plot(x,y,'o', xp,yp)
yp=p(1)*xp + p(2)
x = [2.5:0.5:6,7:10];
y = [1500,1220,1050,915,810,745,690,620,520,480,410,390];
p = polyfit(log10(x),log10(y),1);
m = p(1) ;
b = 10^p(2) ;
xp= 1:.01:100;
yp= b*xp.^m;
loglog(x,y,'o', xp,yp)
time = 0:0.1:0.6;
temp = [300,150,75,35,12,5,2];
p = polyfit(time,log10(temp),1); m = p(1)
b = 10^p(2)
time = 0:0.1:0.6;
temp = [300,150,75,35,12,5,2];
p = polyfit(time,log10(temp),1);
m = p(1)
b = 10^p(2)
time = 0:0.5:4;
voltage = [100,62,38,21,13,7,4,2,3];
p = polyfit(time,log10(voltage),1);
m = p(1);
b = 10^p(2) ;
time_p= 0:0.01:5;
voltage_p= b*10.^(m*time_p);
semilogy(time,voltage,'o', time_p,voltage_p);
x = 550:50:750;
y =[41.2,18.62,8.62,3.92,1.86];
p = polyfit(x,log10(y),1);
m = p(1) ;
b = 10^p(2) ;
xp= 500:10:800;
yp= b*10.^(m*xp);
semilogy(x,y,'o', xp,yp) ;
Farhan GA
5:15 PM
x = 20:10:70;
y = [45,80,130,185,250,330];
xp = 20:0.01:70;
p = polyfit(x,y,2) ;
yp = polyval(p,xp);
J = sum((polyval(polyfit(x,y,2),x)-y).^2);
mu = mean(y);
S = sum((y-mu).^2); r2 = 1-J/S;
r2
x2 = [d2,2*d2,3*d2]';
y = [40, 51, 65, 72, 38, 46, 53, 67, 31, 39, 48, 56]';
Y = X*a;
MaxErrPerc = 100*max(abs((Y-y)./y))
p = [26.1,27,28.2,29,29.8,30.6,31.1,31.3,31,30.5];
t = 1:10;
tp = 1:0.05:10;
coeff1 = polyfit(t,p,1);
coeff2 = polyfit(t,p,2);
coeff3 = polyfit(t,p,3);
p1 = polyval(coeff1,tp);
p2 = polyval(coeff2,tp);
p3 = polyval(coeff3,tp);
b) res2 = p - polyval(coeff2,t);
res3 = p - polyval(coeff3,t);
mu = mean(p);
S = sum((p-mu).^2);
J2 = sum((polyval(coeff2,t)-p).^2);
r23 = 1-J3/S
T = 10:10:90;
S = [35,35.6,36.25,36.9,37.5,38.1,38.8,39.4,40];
coeff = polyfit(T,S,1)
Tplot = 10:0.1:90;
Splot = coeff(1)*Tplot+coeff(2);
plot(T,S,'o',Tplot,Splot),xlabel('T'),ylabel('S')