MATLAB: Superimposing of the boundaries of world countries on a map

colormapgeoshowmatrix manipulation

Hi I have a matrix (the name of matrix is "matrix_of_cluster") with 55 rows and 144 columns,each guy of this matrix is a number (or NaN) which represents a grid of earth (each grid is 2.5 degree*2.5 degree), this matrix covers latitude: 60S-77.5N and longitude: 180W-180E, I mapped this matrix using the following code. I want to put the boundaries of countries on this map. I tried to use worldmap and geoshow functions, but it did not work. How can I do this? The necessary files have been attached.
Var=matrix_of_cluster;
h1=imagesc(Var);
set(h1,'alphadata',~isnan(Var))
colormap hsv(4)
set(gca,'YDir','normal')
colorbar('location','Eastoutside')

Best Answer

Hi Ehsan,
You can use a function I wrote for this called borders. But your lat,lon values are not correct. You'll need to explicitly state those values when you plot with imagesc.