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!