Hey guys,
I need to display my latitude and longitude using the commman geoplot. This is my code:
A=readtable('Filename.xlsx');
lat=(A(:,"Latitud"));
lon=(A(:,"Longitud"));
geoplot(lat,lon);
legend('Ruta 301');
After run this code, thi is the code that i see:
Error using geoplot
Expected lat to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
Instead its type was table.
Error in untitled (line 4)
geoplot(lat,lon);
Please help me if you know wich is my problem.
Thnak you

답변 (2개)

VBBV
VBBV 2022년 4월 24일
편집: VBBV 2022년 4월 24일

0 개 추천

lat=cell2mat(A.Latitud);% if Latitud is the header name of column.
Please check this. There Was extra parenthesis in my previous answer.

댓글 수: 3

VBBV
VBBV 2022년 4월 24일
Use cell2mat for converting values to type double
Thanks a lot for your answer. I try to put on your advice and now, i have a new error...
That is the error:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});
Error in untitled2 (line 2)
lat=(cell2mat(A.Latitud));
VBBV
VBBV 2022년 4월 24일
편집: VBBV 2022년 4월 24일
lat = cell2mat(A.Latitud);% if Latitud is the header name of column.
lat = str2num(lat); % convert the char to number ,

댓글을 달려면 로그인하십시오.

Walter Roberson
Walter Roberson 2022년 4월 24일

0 개 추천

lat = A{:,"Latitud"};
lon = A{:,"Longitud"};
OR
lat = A.Latitud;
lon = A.Longitud;

댓글 수: 2

Thanks Walter for you advice. I used these two options and i have the same error:
Error using geoplot
Expected lat to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
Error in untitled2 (line 4)
geoplot(lat,lon);
I don't know what happened, because the file it's right...

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Geographic Plots에 대해 자세히 알아보기

편집:

2022년 4월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by