How I can bring a specific scenerio of 3D map in matlab?
이전 댓글 표시
"I am trying to create a 3D map in Matlab for a simulation. I have a dataset with latitude, longitude, and altitude values, and I want to use the mesh function to plot the surface. However, I am getting an error message that says 'Z must be a matrix, not a scalar or vector'. How can I fix this error and create the 3D map using my dataset?"
% Define the latitude and longitude
viewer = siteviewer("Buildings","chicago.osm"); #How can i modify this commond and write it my own wish?
lat = [35.339444 ];
lon = [75.541389];
% Define the altitude data
alt = [1000 2000 3000 4000 5000];
% Create a grid of points using the meshgrid function
[Lon,Lat] = meshgrid(lon,lat);
% Create the 3D map using the surf function and geoshow
figure
surf(Lon,Lat,alt)
geoshow('landareas.shp', 'FaceColor', [0.5 0.7 0.5])
댓글 수: 4
Santosh Fatale
2022년 12월 19일
Hi Shujat,
Are you using the code in Bold format anywhere in your code? I belive you are not using it.
Please correct me if I am wrong.
Adam Danz
2022년 12월 19일
Are lon and lat really scalar values? How can you create a map using a single point?
Shujaa
2022년 12월 20일
Adam Danz
2022년 12월 20일
I edited your question to format the code which may have removed text in bold.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!