Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Error using scatterm: LAT and LON, to have NaN-separators in corresponding positions

1 Ansicht (letzte 30 Tage)
Ulla Heede
Ulla Heede am 11 Aug. 2018
Geschlossen: Ulla Heede am 12 Aug. 2018
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

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by