Changeset 26792 for issm/trunk-jpl/src/m/exp/contourlevelzero.m
- Timestamp:
- 01/19/22 06:58:30 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/contourlevelzero.m
r26221 r26792 1 function contours=contourlevelzero(md,mask,level )1 function contours=contourlevelzero(md,mask,level,varargin) 2 2 %CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value) 3 3 % of a vectorial mask, and vectorialize it into an exp or shp compatible … … 7 7 % contours=contourlevelzero(md,mask,level) 8 8 % 9 % Example: 10 % contours=contourlevelzero(md, md.results.TransientSolution(end).MaskOceanLevelset,0); 11 % contours=contourlevelzero(md, md.results.TransientSolution(end).MaskOceanLevelset,0,'output','vector'); 12 % 13 % Supported options: 14 % 'output': either 'matrix' (with NaN delimiters) or 'struct' (default) 15 % 9 16 % See also: PLOT_CONTOUR 17 18 %Process options 19 options = pairoptions(varargin{:}); 10 20 11 21 %process data … … 228 238 229 239 end 240 241 %process output 242 if strcmp(getfieldvalue(options,'output',1),'matrix') 243 x = cell2mat(cellfun(@(x) [x;NaN],{contours(:).x},'UniformOutput',0)'); 244 y = cell2mat(cellfun(@(x) [x;NaN],{contours(:).y},'UniformOutput',0)'); 245 246 contours = [x y]; 247 end
Note:
See TracChangeset
for help on using the changeset viewer.