MATLAB: How to make a heatmap for a monthly time serie

heatmap

I have a monthly time series from jan1971 to dec 1986.
I want to make a heatmap to show the value of each month in each region.
whaen I use the heatmap structure, I should write the name of x-values. but they are192 and I can not write all of them.
xvalues = {'Jan-1971', Feb1971',…, 'Dec 1986'};
yvalues = {'A','B','C','D''};
h = heatmap(xvalues1,yvalues1,cdata1);
could you please let me know the best way to show the xvalues?
could you make the heatmap with the attached data?

Best Answer

Based on the heatmap documentation
tbl = readtable('heatmap.test.xlsx');
months = categorical(tbl.Var2);
years = categorical(tbl.Var1);
xlabels = categories(months);
ylabels = categories(years);
nummonths = numel(xlabels);
numyears = numel(ylabels);
x = double(months);
y = double(years);
A = tbl.A;
cdata = accumarray([y,x],A,[numyears,nummonths],@mean,NaN);
h = heatmap(xlabels,ylabels,cdata);