A=[
1.000.960.980.880.940.610.960.800.980.89
0.961.000.940.900.950.710.960.830.900.88
0.980.941.000.840.910.540.930.730.970.90
0.880.900.841.000.890.850.940.940.800.82
0.940.950.910.891.000.720.940.840.900.90
0.610.710.540.850.721.000.740.900.480.64
0.960.960.930.940.940.741.000.900.920.87
0.800.830.730.940.840.900.901.000.700.75
0.980.900.970.800.900.480.920.701.000.85
0.890.880.900.820.900.640.870.750.851.00];
mat = A; %# A n-by-n matrix of random values from 0 to 1
imagesc(mat); %# Create a colored plot of the matrix values
colormap(flipud(gray)); %# Change the colormap to gray (so higher values are
%# black and lower values are white)
textStrings = num2str(mat