How do do a pcolorm of an array with NaNs?
1 view (last 30 days)
I exported a mask from a coarser resolution to a finer resolution grid.
The grid with finer resolution is a lon x lat grid of size 1440x121 covering my domain.
I want to do a pcolorm(lat,lon,Z) over the region covering this given mask.
Since the mask is from a coarser resolution, the lat, lon and Z over the mask are filled with NaN and I can't get pcolorm to work properly.
-latitude (updownLat) and longitude (updownLon) coordinates for my points of interest (mask);
-the corresponding pressure values at each point of interest (mslp1Arctic);
-1440x121 matrix for the latitude at each grid cell (latMat);
-1440x121 matrix for the longitude at each grid cell (lonMat);
-1440x121 matrix with pressure values at each grid cell (mslp1);
-1440x121 matrix with the latitude values only at the coordinates of the points of interest and NaN elsewhere (latMatMask);
-1440x121 matrix with the longitude values only at the coordinates of the points of interest and NaN elsewhere (lonMatMask);
-1440x121 matrix with the pressure values only at the coordinates of the points of interest and NaN elsewhere (mslp1Mask);
I wish to plot a pcolorm(latMatMask,lonMatMask,mslp1Mask) with all the mslp1 values in the region covered by the mask.
% Figure I want to do
%plotm(updownLat,updownLon,'.'); %Domain where I want to do the pcolorm (mask)
%pcolorm(latMatMask,lonMatMask,mslp1Mask); %NOT WORKING
%cb = colorbar;
I have attached an image for a better visualisation of what I wish to do (matlabQuestion.png).
Thank you! :)