Using the colormap, imagesc, and colorbar commands, write a short MATLAB code to create the following image from a matrix called A that contains only the values 0, 1, and 2. Run your code to verify that it works and show the image output.
Do not simply write out the matrix A explicitly, with 0s, 1s, and 2s, and then display it. You must create the matrix using the above MATLAB syntax constructions - namely, using a double nested for loop.
0.5
2
1
1.8
1.5
1.6
2
1.4
2.5
1.2
3
7
3.5
0.8
0.6
4.5
0.4
5
0.2