[5 pts] Find the dimensions of the rectangular garden producing the greatest enclosed area given 200 feet of fencing.
Answer has to be in MatLab codes
Ans
code:-
%2*(l+b)=200=>l=100-b
max=0;l=0;b=0;%initialise
for i=1:100%length from 1 to 100
j=100-i;%width from 1 to 100
if(i*j>max)%find max area and l,b
max=i*j;
l=i;b=j;
end
end
disp(l);disp(b);%print l,b
length =50, width = 50
Get Answers For Free
Most questions answered within 1 hours.