% puts frame around image
%
% B = frame(A,25);  % puts 25 pixels of NaN around the frame
% B = frame(A,25,max2(A));  % puts 25 pixels of white around the frame
% B = frame(A,25,min2(A));  % puts 25 pixels of black around the frame

function B = frameshowseffetofidr(A,framethickness,framecolor)

if nargin<2 
  disp('frame: defaulting to frame width of 5 pixels')
  framethickness=5;
end%if
if nargin<3
  disp('frame: defaulting to framecolor=NaN')
  framecolor=NaN;
end%if

[M,N]=size(A);

framelef=framethickness;
frametop=framethickness;
framerig=framelef;
framebot=frametop;
B=framecolor*ones(size(A)+[frametop+framebot framelef+framerig]);
B(frametop+1:frametop+M,framelef+1:framelef+N)=A;

