This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: or func_neg = ['' func_1] >> xmax=fminbnd(func_neg,5,10) >> x=xmax or x = fminbnd(func_neg,5,10) >> max_amp=eval(func_1) Problem #9 (20 points) % UPS.m – A program to calculate the maximum volume that can be shipped via UPS % given the largest dimension of a package. % Input max_size = 165; % UPS constrains max length + girth 165 inches % Calculation for index = 1:1:8 % could use length = 35:10:105, but must compute consecutive index length(index) = 35 + 10*(index1); % check lengths from 35105 inches side(index) = (max_size – length(index))/4; % assuming square crosssection volume(index) = length(index)*side(index)^2; end index = 1; %Alternate solution for length = 35:10:105 side(index) = (max_size – length(index))/4; volume(index) = length(index)*side(index)^2; index = index + 1; end % Output plot(length,volume) title('Maximum UPS package volumes') ylabel('Package volume (cu in)') xlabel('Length of package (in)')...
View
Full Document
 Fall '08
 Oakes
 Inch, Answer Sheet ENGR

Click to edit the document details