clear all clc inc = 50; I = 5.42; L = linspace(0, 10, inc); D = linspace(0, 10, inc); %t = linspace(0, 1, inc); for i = 1:length(L) % Count L for j = 1:length(D) % Count D %for k = 1:length(t) % Count t t = (0.290*L(i)*D(j)^2+0.054*D(j)^3)/I; if t/(L(i)+t)>=1/10 A(i,j) = 0/0; end if t>=D(j)/2 A(i,j) = 0/0; else A(i,j) = I/(0.290*L(i)*D(j)^2+0.054*D(j)^3)*(1.875*L(i)+0.992*D(j)); end end end %smallest_area = min(A); surf(L,D,A) %figure %surf(L,t,smallest_area) xlabel('Mean Length') ylabel('Mean Diameter') title('Minimum Area')