geoplot(lat,lon) command error

조회 수: 9 (최근 30일)
VICTOR ALMEIDA
VICTOR ALMEIDA 2020년 7월 22일
답변: VICTOR ALMEIDA 2020년 7월 26일
I am trying to plot a buoy trajectory profile across the ocean surface. I have the trajectory data in an NC file that I have uploaded to MATLAB however it seems as if my geoplot command is connecting my points vertically in the water column (the buoy collects data as deep as 2,000m as it rises to the surface) instead of the buoys breaching points along the surface. I was able to create a red line running through the points once, but never again. The command I have been using after I upload the file to MATLAB is:
lat=ncread(filename,'LATITUDE')
lon=ncread(filename,'LONGITUDE')
geoplot(lat,lon,'r','LineWidth',2)
geobasemap('landcover')
I attached the pictures as a reference so that hopefully someone can understand what my issue is. I added the arrows and numbers to the map with the solid red line as a guide to the buoy trajector after the map was created. I am also confused at how I was able to do it once but not again while using the same commands.
How can I recreate the map that has the solid line running through the points?
  댓글 수: 5
KSSV
KSSV 2020년 7월 22일
First use geobasemap and then try plot using hold on.
VICTOR ALMEIDA
VICTOR ALMEIDA 2020년 7월 22일
It gave me an error message that says:
"Adding Cartesian plot to geoaxes is not supported"
Doing hold on and then geoplot also gave me the same result with just individual points.

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

채택된 답변

VICTOR ALMEIDA
VICTOR ALMEIDA 2020년 7월 26일
Deleting all of the NaN values in relation to the latitude and longitude data and running the commands again worked!

추가 답변 (1개)

KSSV
KSSV 2020년 7월 22일
Try:
geoplot(lat,lon,'r-','LineWidth',2)
  댓글 수: 3
KSSV
KSSV 2020년 7월 22일
Share the poins alone here.
VICTOR ALMEIDA
VICTOR ALMEIDA 2020년 7월 22일
This was what I got when I tried:
geoplot(lat,lon,'r-','LineWidth',2)

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

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by