NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FEM/bwidth.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 %
2 % BWIDTH compute the full bandwidth of an FEM element list
3 %
4 %        INPUT: elems - 3 or 4 column element list; if the element list
5 %                       is 4-column, BWIDTH assumes the first column is
6 %                       an element counter and ignores it.
7 %
8 %        OUTPUT: bandwidth
9 %
10 %  bw=bwidth(elems)
11 %
12 function bw=bwidth(elems)
13
14 err1=['matrix of elements must be 3 or 4 columns wide'];
15
16 % check size of element matrix
17 % nelems = number of elements, s = # of cols
18 if nargin~=1
19    error('BWIDTH needs element list');
20 end
21 [nelems,s]=size(elems);
22 if s~=3 & s~=4
23    error(err1);
24 end
25 if s==4
26    elems=elems(:,2:4);
27 end
28
29 bw=2*max(max(elems')-min(elems'))+1;
30
31 return
32
Note: See TracBrowser for help on using the browser.