From: Jonathan on 5 Mar 2010 00:42 Hi, I have created the following mapstructs file so that I can export the coordinate information as a shapefile, which can be opened in ArcGIS. My code is as follows: fname=sprintf('CoosCty_CoastalStats.xlsx'); fname2=sprintf('CoosCty_CoastalStats'); Data = xlsread(fname, fname2, 'A4:D19'); id = Data(:,1); %1,2,3,4,... X = Data(:,2); %1171161.403,1171200.82,... Y = Data(:,3); %142616.162,142637.881,... z = Data(:,4); %74, 79,... [pfd.Geometry] = deal('MultiPoint'); pfd.id = id; pfd.X = X; pfd.Y = Y; pfd.z = z; shapewrite(pfd, 'pfd'); I am experiencing an error on the last line. The error message I get is "Attribute field z of geographic data structure S contains at least one value that is not a scalar double." It actually hangs when trying to convert both id and z variables above. I have no idea what is wrong with my code. Any help would be much appreciated. Thanks Jon
From: Jonathan on 7 Mar 2010 09:42 "Jonathan" <jkakiwi(a)yahoo.co.uk> wrote in message <hmq5jd$9bd$1(a)fred.mathworks.com>... > Hi, > > I have created the following mapstructs file so that I can export the coordinate information as a shapefile, which can be opened in ArcGIS. My code is as follows: > > fname=sprintf('CoosCty_CoastalStats.xlsx'); > fname2=sprintf('CoosCty_CoastalStats'); > Data = xlsread(fname, fname2, 'A4:D19'); > > id = Data(:,1); %1,2,3,4,... > X = Data(:,2); %1171161.403,1171200.82,... > Y = Data(:,3); %142616.162,142637.881,... > z = Data(:,4); %74, 79,... > > [pfd.Geometry] = deal('MultiPoint'); > pfd.id = id; > pfd.X = X; > pfd.Y = Y; > pfd.z = z; > shapewrite(pfd, 'pfd'); > > I am experiencing an error on the last line. The error message I get is > > "Attribute field z of geographic data structure S contains > at least one value that is not a scalar double." > > It actually hangs when trying to convert both id and z variables above. I have no idea what is wrong with my code. Any help would be much appreciated. I'm still having problems with my code above. Could someone explain to me the hoe to convert one of my arrays to scalar double precision. I had a look around in Matlab but could not see anything obvious. Thanks Jon
|
Pages: 1 Prev: rorate laTex labels Next: memx memory leak in timestwo example in documentation? |