source:
issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff
Last change on this file was 26740, checked in by , 3 years ago | |
---|---|
File size: 1.9 KB |
-
../trunk-jpl/src/m/modules/ExpToLevelSet.m
13 13 14 14 % Check usage 15 15 if nargin~=3 16 17 16 help ExpToLevelSet 17 error('Wrong usage (see above)'); 18 18 end 19 19 20 20 multipleShp = 0; 21 21 22 22 if ischar(contourname), 23 24 25 26 27 28 29 30 23 [path,name,ext]=fileparts(contourname); 24 if strcmpi(ext,'.shp'), 25 %read contour from shapefile 26 contourname=shpread(contourname); 27 if isstruct(contourname) 28 multipleShp = size(contourname, 2); 29 end 30 end 31 31 end 32 32 33 33 % Call mex module 34 34 if multipleShp>0 35 36 37 38 39 40 41 42 35 % shp file contains multiple contours 36 distance = zeros(length(x)+1, multipleShp); 37 for i = 1:multipleShp 38 distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i)); 39 % append the NAME information at the end of the distance 40 if isfield(contourname(i),'NAME') 41 distance(end, i) = contourname(i).NAME; 42 else 43 43 distance(end, i) = i; 44 45 44 end 45 end 46 46 else 47 48 47 % single shape or exp file 48 distance = ExpToLevelSet_matlab(x,y,contourname); 49 49 end
Note:
See TracBrowser
for help on using the repository browser.