Code covered by the BSD License  

Highlights from
Publish dependent and called functions

Publish dependent and called functions

by

 

26 Oct 2011 (Updated )

Publish explicitly called functions not found in the MATLAB root. See mfile for limitations.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Volume_Flow( r0 )
function [ Q ] = Volume_Flow( r0 )
%%
% Compuation of volume flow rate in a pipe as a function of radius.
% 
% Syntax: [ Q ] = Volume_Flow( r0 )
%
% input: r0 = radium (cm)
%
% output: Q = volume flow rate (cm^3/s)      

v = @(r) 2*(1 - r./r0).^(1/6);
f = @(r) v(r).*2*pi.*r;

Q = quad(f,0,r0);

Contact us