This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: % Name, Section # % This function finds the relative pressure on the front of a car vertically % across the grill. % Inputs: x - vector of vertical positions (inches) % Outputs: P_ave - average pressure (PSI) % P_max - maximum pressure (PSI) % Step 1: P = 0.6*sin(x-10)-0.08*(x-10).^2+0.25*(x-10)+15; % PSI % Step 2: P_ave = mean(P); % PSI % Step 3: P_max = max(P); % PSI % Step 4: plot(x,P) title( 'Pressure vs. Position' ) xlabel( 'Position Along Front of Vehicle (inches)' ) ylabel( 'Pressure (PSI)' ) grid on Command Window Output >> x = 0:30; % inches >> [P_ave, P_max] = Car_Pressure (x) P_ave = 7.842 P_max = 15.726 5 10 15 20 25 30-15-10-5 5 10 15 20 Pressure vs. Position Position Along Front of Vehicle (inches) Pressure (PSI)...
View Full Document
This note was uploaded on 04/02/2012 for the course EGR 100 taught by Professor Hinds during the Fall '08 term at Michigan State University.
- Fall '08