title: How can I declare a global variable in Matlab for a few functions?
body: <p>I have a file called <code>histShape.m</code> with a function <code>histShape</code> , and some other functions also .</p>
  
  <p>A general view of the code is : </p>
  
  <pre><code>%
  function [outputImage] = histShape(srcimg, destimg)
  
      PIXELS = 255 + 1;
  
       ....
       ....
  end
  
  
  
  %
  function [outputImage] = normalizeAndAccumulate(inputImage)
  
     PIXELS = 255 + 1;
  
  ....
  ....
  
  end
  
  %
  function [pixels] = getNormalizedHistogram(histogram , inputImage)
  
  
     PIXELS = 255 + 1;
  
    ....
    ....
  
  end
  </code></pre>
  
  <p>I can use <code>global x y z;</code>  but I'm looking for a different way .</p>
  
  <p>I want to declare the variable <code>PIXELS</code> as global , how can I do that ? </p>
  
  <p>Regards</p>