MATLAB: Plot grided latitude and longitude as pixels on map

MATLABplot

I want to plot gridded latitude and longitude as pixels on the map, Latitude is 1 x 32 and longitude is 1 x 40 I don't know how to this I tried geoshow but it said latitude and longitude must have the same size.
Error using checklatlon (line 25)
Function GEOSHOW expected its first and second input arguments,
LAT and LON, to match in size.
Error in geovecshow (line 37)
checklatlon(lat, lon, 'GEOSHOW', 'LAT', 'LON', 1, 2);
Error in geoshow (line 278)
h = showFcn(varargin{:});
I attache latitude and longitude. latitude and longitude are taken from the NetCDF file for gridded precipitation data, but I just want to plot its pixels and I don't need precipitation data.
I want to plot them on this map:
Code to generate map:
% Produce the map
borders('Iran Islamic Republic of') % borders is a function from Matlab file exchange by Chad A Greene (https://www.mathworks.com/matlabcentral/fileexchange/50390-borders)
grid on
axis equal % I added this, important to maintain aspect ratio (@AD)
xlabel('Longitude')
ylabel('Latitude')
xtickangle(90)
I want to plot the pixels like this: (ignore the color bar and colors I just want pixels)
Thank you

Best Answer

I obtain this result:
by running the following code:
load lati.mat
load loni.mat
[LONG, LAT] = meshgrid(loni,lati);
Z = rand(length(lati),length(loni));
figure
surface(LONG, LAT, Z)
colorbar
xlabel('Longitude')
ylabel('Latitude')
xticks(loni)
yticks(lati)
xtickangle(90)
grid on
ax = gca;
ax.XAxis.FontSize = 7;
ax.YAxis.FontSize = 7;
In my example I generate ramdomly Z matrix, instead you should have a matrix with data in function of latitude and longitude coordinates. From your plot I see that some "pixels" are blank. This means that you can fill Z matrix with NaN values, in this way you obtain easily blank pixels.