Info
This question is closed. Reopen it to edit or answer.
Error using scatterm: LAT and LON, to have NaN-separators in corresponding positions
2 views (last 30 days)
Show older comments
I'm trying to plot values on a map using the mapping toolbox. The points are given by latitude and longitudes lat1 and lon1, and I would like each point to have a different color, determined by the vector A. I have the following code, but I get an error: "Function SCATTERM expected its first and second input arguments, LAT and LON, to have NaN-separators in corresponding positions."
I'm not sure what this means. How do a create NaN-separators in corresponding positions?
Thanks!
%create the map axes. See http://www.mathworks.com/help/map/the-map-frame.html
axesm('MapProjection','robinson',...
'MapLatLimit',[-90 90],'MapLonLimit',[-180 180], ...
'Frame','on','Grid','on', 'MeridianLabel', 'off', 'ParallelLabel', 'off')
%load the coast data and plot. See http://www.mathworks.com/help/map/create-a-world-map.html
load coast
[latcells, loncells] = polysplit(lat, long);
numel(latcells)
plotm(lat, long,'color',[0 0 0]); hold on
pointsize=10;
h1=scatterm(lat1,lon1,pointsize,A);
colorbar
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!