{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

solution12

# solution12 - fprintf'Flow rate using trapz =%5.2f cubic...

This preview shows pages 1–2. Sign up to view the full content.

% Assignment 12 % Prob. 1 f1=inline('exp(-x)'); F1=f1([1:5]) F1 = 0.36788 0.13534 0.049787 0.018316 0.0067379 % Prob. 2 f2=inline('cos(a*x)/(b+2)','a','b','x'); F2=f2(2,3,[0.1 0.2 0.3]) F2 = 0.19601 0.18421 0.16507 % Prob. 3 f3=inline('(x+2).*tan(y)','x','y'); F3=f3([0:1:5],[0:0.5:2.5]) F3 = 0 1.6389 6.2296 70.507 -13.11 -5.2292 % Prob. 4 % See handwritten page for part (a) % Part (b) r=0:0.1:1; A=pi*r.^2; V=5*(1-r.^2); Qb=trapz(A,V);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fprintf('Flow rate using trapz = %5.2f cubic ft/s',Qb) disp(' ') % Part (c) Qc=quad('5*(1-r.^2)*2*pi.*r',0,1); fprintf('Flow rate using quad = %5.2f cubic ft/s\n',Qc) disp(' ') Flow rate using trapz = 7.85 cubic ft/s Flow rate using quad = % Prob 5 r=0:0.1:1; V=[5.04 4.93 4.74 4.6 4.26 3.73 3.30 2.51 1.78 0.97 0]; A=pi*r.^2; Q=trapz(A,V); fprintf('The flow rate = %5.2f cubic ft/s',Q) The flow rate = 7.89 cubic ft/s...
View Full Document

{[ snackBarMessage ]}