Help plotting world map with 192x144 matrix of data?
1 view (last 30 days)
Show older comments
I have a mat file with sensitivity data for the globe. The matrix is 192x144 (longitude x latitude). I need to plot a global map with this data. I know it should be relatively simple, but when I try to plot it using worldmap and geoshow it comes up as all zeros. This is my code:
data = load('bkohl_A.mat'); % data
A = struct2cell(data); % change from struct to double input matrix
out = cat(2,A{:});
rv = [0.4, 90, 0] % grid resolution and corner
worldmap('World');
geoshow(out, rv, 'displaytype', 'texturemap'); % plot data
load coastlines;
plotm(coastlat,coastlon) % plot coastlines
I have tried plotting a test using rand(192,144) and it worked, but when I plotted zeros(192,144) and then changed the first few rows to 1's it didn't. (so I had a 192 x 144 matrix of zeros with the first 10 rows 1 but it still showed on the map as all zeros).
I have no idea what I'm doing wrong and I've looked through the documentation but couldn't find anything to help. Any help would be appreciated!!
2 Comments
Answers (1)
Anshika Chourasia
on 29 Dec 2021
Hi,
Please cross-check the correctness of data file and try changing few columns’ values to 1’s to validate the output.
If the issue stills persist, please provide more information to further investigate into the problem.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!