
Text :-
year = [0 5 7 16 25 31 37];
MGS = [0.8 0.4 0.2 0.09 0.007 2e-4 8e-6];
plot(year,MGS,'-*','LineWidth',1.2)
grid on
xlabel("Number of Years from 1967");
ylabel("Minimum Gear Size [mm]");
title("Size Variation of Gear over Years")
%Other Experiment plot using fplot
figure(2)
f = @(t) 2.5*exp(-0.5*t);
fplot(f,[0,37],'LineWidth',1.2);
grid on
xlabel("Number of Years from 1967");
ylabel("Minimum Gear Size [mm]");
title("Exponential Gear Size Variation over years")
% Fiting exponential
figure(3)
% MGS = a*e^(b)*t;
% Taking Log on both sides :
% Log(MGS) = Log(a) + b*t
p = polyfit(year,log(MGS),1);
exp_fit_MGS = polyval(p,year);
plot(year,log(MGS),"*"); % Ploting Data Points
hold on
plot(year,exp_fit_MGS,'LineWidth',1.2) % Ploting Fitted curve
legend(["Data Points","Exponential Fit"],'Location','Best')
xlabel("Number ofYears from 1967");
ylabel("Log(MGS)");
title("Exponential fit on semilog plot")
grid onyear = [0 5 7 16 25 31 371: MGS = [0.8 0.4 0.2 0.09 0.007 2e-4 8e-61: plot (year, MGS, -*", 'LineWidth',1.2) grid on xlabel ("Number of Years from 1967") ylabel ("Minimum Gear Size [m]") title("Size Variation of Gear over Years") other Experiment plot using fplot figure (2) (t) 2.5 exp (-0.5*t) plot(E, [,37], 'LineWidth',1.2); grid on xlabel ("Number of Years from 1967") ylabel ("Minimum Gear Size [m]") title("Exponential Gear Size Variation over years") Fiting exponential figure (3) % Taking Log on both sides : % Log (MGS ) -Log (a) + b*t p -polyfit(year, log (MGS),1): exp fit MGSpolyval (p, year) plot (year,log (MGS),"*"); hold on plot (year,exp fit MGS, "LineWidth',1.2) legend (["Data Points", "Exponential Fit"], 'Location', "Best' xlabel ("Number offears from 1967") ylabel ("Log (MGS)") title("Exponential fit on semilog plot" grid on % Ploting Data Points % Ploting Fitted curve
Size Variation of Gear over Years 0.8 0.7 0.6 D 0.5 0.4 20.3 0.2 0.1 10 15 20 25 30 35 40 Number of Years from 1967
Exponential Gear Size Variation over years 2.5 N1.5 0.5 10 15 20 25 30 35 Number of Years from 1967
Exponential fit on semilog plot Data Points Exponential Fit -2 00 4 -4 -6 -8 -10 -12 20 Number of Years from 1967 10 15 25 30 35 40