// displays a matrix as a gray-level picture function show_mat(A, orig) [n,m] = size(A); [lhs, rhs]=argn(); if (rhs==1) then orig=[0,0]; xbasc(); end // detect row coded vector instead of a matrix if n==1 then A=matrix(A,28,28); [n,m] = size(A);end x = [orig(1):1./(n-1):orig(1)+1]; y = [orig(2)+1:-1./(m-1):orig(2)]; ncolor = 255; h=graycolormap(ncolor); xset('colormap',h); grayplot(x,y,A,frameflag=8); endfunction