geoscatter unable to interpreting table values

Hi y'all,
I am trying to use geoscatter to plot some points on a map. I think the issue is how Matlab is representing the table values - in scientific notation, when the original csv doesn't. But maybe I'm wrong. I tried a few ways to reformat the values but I've been unsuccessful.
The error I get is as follows:
Error using geoscatter (line 103)
Expected lat to be an array with all of the values <= 90.
Error in Map (line 70)
geoscatter(station11THg.Lat, station11THg.Long, 'filled', 'r')
My code is:
station11THg = SimpleSamples([SimpleSamples{:,4} == 11], [2, 3]) ;
station14THg = SimpleSamples([SimpleSamples{:,4} == 14], [2, 3]) ;
figure (1)
geobasemap satellite
hold on
geoscatter(station11THg.Lat, station11THg.Long, 'filled', 'r') % Where issue occurs
geoscatter(station14THg.Lat, station14THg.Long, 'filled', 'r')
hold off
I've attached a simplified file for reference.
I am using Matlab version: R2024b
Thanks!

3 comentarios

Mathieu NOE
Mathieu NOE el 6 de En. de 2026
hello
looking at the content of the csv file , I have this :
Date_samples_taken,Long,Lat,Station_No
2025-05-28,7235.3,3701.3,11
2025-05-28,7235.3,3701.3,11
2025-05-28,7234,3701.3,14
2025-05-28,7234,3701.3,14
so the comma is the field separator and the dot is the decimal separator
unless there is something we don't know when the data was recorded but Long and Lat data are like 7234 and 3701.3 (and matlab just gives those numbers, eventually in scientific notation - but that's not the point here)
so not really in the expected range - is there a conversion factor we are not aware of ?
Kristine
Kristine el 6 de En. de 2026
Well that's embarassing. I just forgot to adjust the values. Thanks!
Mathieu NOE
Mathieu NOE el 7 de En. de 2026
haha no problem !
have a nice day !

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de En. de 2026

0 votos

The original csv file has values like 7235.3 for Long and 3701.3 for Lat. Those values are well outside the expected range.
You need to divide Lat and Long by 100.

Más respuestas (0)

Productos

Versión

R2024b

Etiquetas

Preguntada:

el 6 de En. de 2026

Comentada:

el 7 de En. de 2026

Community Treasure Hunt

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

Start Hunting!

Translated by