No BSD License  

Highlights from
Basic Image Processing

from Basic Image Processing by Sandeep
This will help those who start doing Image Processing with Matlab

[d]=subtract(s1,s2);
function [d]=subtract(s1,s2);
ai=double(s1);
bi=double(s2);
a=size(ai);
b=size(bi);
  if a(1)<b(1)
    ai=[ai;zeros(b(1)-a(1),a(2))];
  else
    bi=[bi;zeros(a(1)-b(1),b(2))];   
  end
  
  a=size(ai);
  b=size(bi);
  
  if a(2)<b(2)
    ai=[ai zeros(a(1),b(2)-a(2))];
  else
    bi=[bi zeros(b(1),a(2)-b(2))];   
  end

  d=ai-bi;           % to find the difference
  d=d+min(min(d));
  d = (d/(max(max(d))))*255;
%   figure
%   imshow(d,[]);

Contact us at files@mathworks.com