title: Error using ~= Matrix dimensions must agree
body: <p>I'm using the following code of &quot;Computed tomography-based volumetric tool for standardized measurement of the maxillary sinus&quot; article to measure the volume of the maxillary sinus in DCOM images:</p>
  <pre><code>% Read images
  clear all
  close all
  
  [filename, pathname] = uigetfile('*','Select CT exam (all slices)','MultiSelect','on');
  num= length(filename);
  bbbb=1;
  
  
  step=input('Step of image reading: \')
  
  
  for aaaa = 1:step:num
      xinfo=dicominfo([pathname,char(filename(aaaa))]);
      pxsp=cat(2,xinfo.PixelSpacing);
      x=dicomread([pathname,char(filename(aaaa))])+cat(2,xinfo.RescaleIntercept);
      k=x;
      k = im2bw(k,0.49);
      k = imfill(k,'holes');
      cc = bwconncomp(k);
      stats = regionprops(cc,'Area');
      A = [stats.Area];
      [~,biggest] = max(A);
      k(labelmatrix(cc)~=biggest) = 0;
      x(k~=1)=-2000;     
      masccranio(:,:,bbbb)=k;
      cranio(:,:,bbbb)=x;
      cranio_full(:,:,bbbb)=x;
      bbbb=bbbb+1;
      end
  </code></pre>
  <p>at the first, we don't have any idea about the reading step input at the beginning, please help on that if you can. Our second problem is when we run the code we get the following error:</p>
  <pre><code>Error using  ~= 
  Matrix dimensions must agree.
  
  Error in Quant (line 32)
      k(labelmatrix(cc)~=biggest) = 0;
  </code></pre>
  <p>I'm using Matlab 2019b and as I know this code is for 2013. Any help is appreciated.</p>