source:
issm/oecreview/Archive/25834-26739/ISSM-26630-26631.diff@
27230
Last change on this file since 27230 was 26740, checked in by , 3 years ago | |
---|---|
File size: 1.3 KB |
-
../trunk-jpl/src/m/shp/shp2exp.m
47 47 end 48 48 elseif strcmpi(shp(i).Geometry,'Point'), 49 49 x=shp(i).X; y=shp(i).Y; 50 expstruct(end+1).x=x; 51 expstruct(end).y=y; 52 expstruct(end).nods=length(x); 53 expstruct(end).density=1; 54 expstruct(end).closed=0; 55 %exp(end).name=num2str(shp(i).id); 50 if ~isnan(x) && ~isnan(y) 51 expstruct(end+1).x=x; 52 expstruct(end).y=y; 53 expstruct(end).nods=length(x); 54 expstruct(end).density=1; 55 expstruct(end).closed=0; 56 %exp(end).name=num2str(shp(i).id); 57 end 58 elseif strcmpi(shp(i).Geometry,'PointZ'), 59 shp(i) 56 60 elseif strcmpi(shp(i).Geometry,'Line'), 57 x=shp(i).X; y=shp(i).Y; 58 expstruct(end+1).x=x; 59 expstruct(end).y=y; 60 expstruct(end).nods=length(x); 61 expstruct(end).density=1; 62 expstruct(end).closed=0; 61 x=shp(i).X(:); y=shp(i).Y(:); 62 pos = find(~isnan(x) & ~isnan(y)); 63 idx=find(diff(pos)~=1); 64 A=[idx(1);diff(idx);numel(pos)-idx(end)]; 65 Cx=mat2cell(x(pos),A,1); 66 Cy=mat2cell(y(pos),A,1); 67 for i=1:numel(Cx) 68 expstruct(end+1).x=Cx{i}; 69 expstruct(end).y=Cy{i}; 70 expstruct(end).nods=length(Cx{i}); 71 expstruct(end).density=1; 72 expstruct(end).closed=0; 73 end 63 74 end 64 75 end 65 76
Note:
See TracBrowser
for help on using the repository browser.