Collin Tuttle asked . 2022-01-13

Plotting geographic data not oriented on a grid

I have a column vector of data (23038 x 1), which corresponds to a column vector of the same length for latitude and another for longitude. I am attempting to plot this data (I have used surfm, surfacem, pcolorm), but it always causes MATLAB to slow down to the point of crashing. I assume that this is because matlab prefers the data to be oriented at a 2D matrix (grid). Is this correct, and if so how would I convert the data for plotting?
Thanks!
 

plotting , matlab , map , image processing , plotting

Expert Answer

Prashant Kumar answered . 2024-03-25 10:12:06

First of all, really neat looking map when you just plot the points at which the data was taken:
 

plotting geographic

Using griddata, you can mesh out your current dataset into a grid:

latmin = min(lat_piomas);
latmax = max(lat_piomas);
lonmin = min(lon_piomas);
lonmax = max(lon_piomas);
gridSize = [100 200];
latvec = linspace(latmin, latmax, gridSize(1));
lonvec = linspace(lonmin, lonmax, gridSize(2));
[LatQ LonQ] = ndgrid(latvec, lonvec);
ThickQ = griddata(lon_piomas, lat_piomas, thickness, LonQ, LatQ);

From there, it's a simple matter to show the data in whichever format you like:

figure
axesm('mercator', 'MapLonLimit', [0 360])
geoshow(LatQ, LonQ, ThickQ, 'DisplayType', 'surface')

plotting geographic

And if you want to get real fancy, you can use topological data to show the elevation of the surface, while using the color to show the "thickness" data. Here's an example using built-in example topography data:

% Get example topography data
load topo topo topolatlim topolonlim
Rtopo = georefcells(topolatlim, topolonlim, size(topo));
ElevQ = geointerp(topo, Rtopo, LatQ, LonQ, 'cubic');

% Display the surface
figure
axesm('mercator', 'MapLonLimit', [0 360])
geoshow(LatQ, LonQ, ElevQ, 'DisplayType', 'surface', 'CData', ThickQ)
daspectm('m', 1000) % To exaggerate the height of the topography

plotting geographic


Not satisfied with the answer ?? ASK NOW

Frequently Asked Questions

MATLAB offers tools for real-time AI applications, including Simulink for modeling and simulation. It can be used for developing algorithms and control systems for autonomous vehicles, robots, and other real-time AI systems.

MATLAB Online™ provides access to MATLAB® from your web browser. With MATLAB Online, your files are stored on MATLAB Drive™ and are available wherever you go. MATLAB Drive Connector synchronizes your files between your computers and MATLAB Online, providing offline access and eliminating the need to manually upload or download files. You can also run your files from the convenience of your smartphone or tablet by connecting to MathWorks® Cloud through the MATLAB Mobile™ app.

Yes, MATLAB provides tools and frameworks for deep learning, including the Deep Learning Toolbox. You can use MATLAB for tasks like building and training neural networks, image classification, and natural language processing.

MATLAB and Python are both popular choices for AI development. MATLAB is known for its ease of use in mathematical computations and its extensive toolbox for AI and machine learning. Python, on the other hand, has a vast ecosystem of libraries like TensorFlow and PyTorch. The choice depends on your preferences and project requirements.

You can find support, discussion forums, and a community of MATLAB users on the MATLAB website, Matlansolutions forums, and other AI-related online communities. Remember that MATLAB's capabilities in AI and machine learning continue to evolve, so staying updated with the latest features and resources is essential for effective AI development using MATLAB.

Without any hesitation the answer to this question is NO. The service we offer is 100% legal, legitimate and won't make you a cheater. Read and discover exactly what an essay writing service is and how when used correctly, is a valuable teaching aid and no more akin to cheating than a tutor's 'model essay' or the many published essay guides available from your local book shop. You should use the work as a reference and should not hand over the exact copy of it.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.