Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.m =================================================================== --- ../trunk-jpl/src/m/modules/ExpToLevelSet.m (revision 26540) +++ ../trunk-jpl/src/m/modules/ExpToLevelSet.m (revision 26541) @@ -13,37 +13,37 @@ % Check usage if nargin~=3 - help ExpToLevelSet - error('Wrong usage (see above)'); + help ExpToLevelSet + error('Wrong usage (see above)'); end multipleShp = 0; if ischar(contourname), - [path,name,ext]=fileparts(contourname); - if strcmpi(ext,'.shp'), - %read contour from shapefile - contourname=shpread(contourname); - if isstruct(contourname) - multipleShp = size(contourname, 2); - end - end + [path,name,ext]=fileparts(contourname); + if strcmpi(ext,'.shp'), + %read contour from shapefile + contourname=shpread(contourname); + if isstruct(contourname) + multipleShp = size(contourname, 2); + end + end end % Call mex module if multipleShp>0 - % shp file contains multiple contours - distance = zeros(length(x)+1, multipleShp); - for i = 1:multipleShp - distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i)); - % append the NAME information at the end of the distance - if isfield(contourname(i),'NAME') - distance(end, i) = contourname(i).NAME; - else + % shp file contains multiple contours + distance = zeros(length(x)+1, multipleShp); + for i = 1:multipleShp + distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i)); + % append the NAME information at the end of the distance + if isfield(contourname(i),'NAME') + distance(end, i) = contourname(i).NAME; + else distance(end, i) = i; - end - end + end + end else - % single shape or exp file - distance = ExpToLevelSet_matlab(x,y,contourname); + % single shape or exp file + distance = ExpToLevelSet_matlab(x,y,contourname); end