title: mask a portion of image in matlab?
body: <pre><code>Image1=imread('depthmp.png');
  [row1,column1]=size(Image1);
  B = imresize(Image1, [375 150]);
  [row3,column3]=size(B);
  subplot(2, 2, 1);
  imshow(Image1);
  mask = zeros(row3, column3, 'uint8');
  mask(30:300, 5:150) = 255;
  subplot(2, 2, 2);
  imshow(mask);
  subplot(2,2,3);
  C=imadd(mask,Image1);
  imshow(C);
  </code></pre>
  
  <p>Here is my code to mask a portion of image.but am getting an error.The error is as follows
  "Error using imadd (line 69)
  X and Y must have the same size
  and class or Y must be a scalar
  double."
  Can anyone sort out the problem please????</p>