MATLAB: X-axis ticks on heatmap

heatmap

Hi,
I am learning to draw a heatmap in matlab. I can add x-axis labels or numbers. But I don't know how to add ticks on x-axis corresponding to the numbers. Can anyone help me with this? Thanks!
the set(gca,'XTick') works when you use plot but doesn't work for a heatmap object. 🙁

Best Answer

plot(1:10)
set(gca,'XTick',2:2:10)