MATLAB: Colormap for a matrix

plot

Given a matrix:
0 0.0104 0.0027
0.0104 0 0.0163
0.0027 0.0163 0.0000
I am using imagesc(corrData). However I would like to only have the integers displayed on x- and y-axis ("1","2" and "3"). How can I accomplish that?

Best Answer

Use xticks and yticks():
m = [ 0 0.0104 0.0027
0.0104 0 0.0163
0.0027 0.0163 0.0000]
imagesc(m);
axis on;
xticks(1:size(m, 2));
yticks(1:size(m, 1));