I solved this problem with a simple technique using 'max' function.
data_2d = max(MYD_countries, [], 1); %taking maximum along the first dimension retains the data for each country since values are NaN elsewhere.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!