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

root/gliderproc/trunk/MATLAB/opnml/VIZICQ4_1.2/fd_cube.m

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

Initial import of Stark code.

Line 
1 function S=fd_cube(nlims,dlims)     
2
3 nx=nlims(1);
4 ny=nlims(2);
5 nz=nlims(3);
6
7 minx=dlims(1);
8 maxx=dlims(2);
9 miny=dlims(3);
10 maxy=dlims(4);
11 minz=dlims(5);
12 maxz=dlims(6);
13
14 x=linspace(minx,maxx,nx+1);
15 y=linspace(miny,maxy,ny+1);
16 z(1,1,:)=linspace(minz,maxz,nz+1);
17
18 [X2D,Y2D]=meshgrid(x,y);
19
20 % Replicate 2D vertically
21 X3D=repmat(X2D,[1 1 nz+1]);
22 Y3D=repmat(Y2D,[1 1 nz+1]);
23 % Replicate 1D vert in 2D horz
24 Z3D=repmat(z,[nx+1 ny+1 1]);
25
26 % Build return structure
27 S=struct('X3D',X3D,'Y3D',Y3D,'Z3D',Z3D);
Note: See TracBrowser for help on using the browser.