I have an array (MYD_countries) of size 249*64800 in which the first dimension represents different countries in the world and the second dimension represents global data grid cells of 1-degree data (180*360 = 64800). Each country data has data values within the country grid points and NaN elsewhere. I want to combine the data of all countries together and reduce its dimension to 1*64800 so that I can plot it at one call using geoshow. I have tried it using a loop as below but it is only storing the last country data, not all country data. Could anybody help please?
for i = 1:249;
for j = 1:64800;
if(MYD_countries(i, j) ~= NaN);
MYD_all_countries_plot (1, j) = MYD_countries (i, j);
else;
end;
end;
end;