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*(index-1); % check lengths from 35-105 inches side(index) = (max_size – length(index))/4; % assuming square cross-section 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
This note was uploaded on 09/14/2009 for the course ENGR 126 taught by Professor Oakes during the Fall '08 term at Purdue.
- Fall '08