Slice Displaying Grids Instead of Color
Show older comments
Just like the title said, I have a problem with displaying the correct slice. I attach the said generated figure below. Also this is my test script:
tas = ncread("data\dary_ATM.2023030100.nc", "ta");
lat = ncread("data\dary_ATM.2023030100.nc", "lat");
lon = ncread("data\dary_ATM.2023030100.nc", "lon");
kz = ncread("data\dary_ATM.2023030100.nc", "kz");
time = ncread("data\dary_ATM.2023030100.nc", "time");
ta = ncread("data\dary_ATM.2023030100.nc", "ta"); ta = ta - 273.15;
ua = ncread("data\dary_ATM.2023030100.nc", "ua"); ua = ua(:, :, 1, 4);
va = ncread("data\dary_ATM.2023030100.nc", "va"); va = va(:, :, 1, 4);
wa = ncread("data\dary_ATM.2023030100.nc", "wa"); wa = wa(:, :, 1, 4);
[longrid, latgrid] = meshgrid(lon, lat);
kzlevel = 18;
kz2d = kz(kzlevel) * ones(size(longrid));
[x,y,z] = meshgrid(lon, lat, kz);
ta = squeeze(ta(:,:,:,1));
figure;
slice(x,y,z,ta,[],[],1:4);
colormap("turbo");
colorbar;
clim([0 50]);
axis xy;

2 Comments
Mathieu NOE
on 20 Jan 2025
hello
you need tp rovide the data file if you want someone to help you
Asyam Mulayyan
on 20 Jan 2025
Edited: Asyam Mulayyan
on 20 Jan 2025
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

