MATLAB: Matlab code

image processingmatrix

hiii i need a matlab code on how to view a matrix as an image ???? we have a matrix and i need to view it as image

Best Answer

Hi,
You can use imagesc command from Matlab
A = [ 0 1 1 1 0;
0 1 1 1 0;
0 0 1 0 0;
0 0 1 0 0;
1 1 1 1 1;
0 0 1 0 0;
0 0 1 0 0;
0 1 1 1 0;
1 0 0 0 1];
imagesc(A); colormap(gray);
axis square;