Home > utilities > ST_wentworth.m

ST_wentworth

PURPOSE ^

Report wentworth class of a particular grain size phi

SYNOPSIS ^

function [Sclass] = wentworth(phi)

DESCRIPTION ^

 Report wentworth class of a particular grain size phi 

 function wentworth(phi) 

 DESCRIPTION:
    Report the wentworth of a grain size phi

 INPUT:
    phi: sediment grain size in phi scale

 OUTPUT:
    prints wentworth class to screen

 EXAMPLE USAGE
    wentworth(2.5) 

 Author(s):  
    Geoff Cowles (University of Massachusetts Dartmouth)

 Revision history
   
==============================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Sclass] = wentworth(phi)
0002 % Report wentworth class of a particular grain size phi
0003 %
0004 % function wentworth(phi)
0005 %
0006 % DESCRIPTION:
0007 %    Report the wentworth of a grain size phi
0008 %
0009 % INPUT:
0010 %    phi: sediment grain size in phi scale
0011 %
0012 % OUTPUT:
0013 %    prints wentworth class to screen
0014 %
0015 % EXAMPLE USAGE
0016 %    wentworth(2.5)
0017 %
0018 % Author(s):
0019 %    Geoff Cowles (University of Massachusetts Dartmouth)
0020 %
0021 % Revision history
0022 %
0023 %==============================================================================
0024 
0025 ClassNames = {'boulder','cobble','pebble','granule','very coarse sand', ...
0026    'coarse sand','medium sand','fine sand','very fine sand','coarse silt', ...
0027    'medium silt','fine silt','very fine silt','coarse clay','medium clay','fine clay'}; 
0028 ClassLbound = [-1e6,-8,-6,-2,-1,0,1,2,3,4,5,6,7,8,9,10]; 
0029 pts = find(phi-ClassLbound > 0);
0030 ClassIndex = pts(end); 
0031 Sclass = char(ClassNames{ClassIndex});
0032 %fprintf('class of phi = %f is: %s\n',phi,class);

Generated on Tue 18-Dec-2012 12:37:31 by m2html © 2005