title: Access methods with other classes in MATLAB
body: <p>I am teaching myself how to use object oriented programming with MATLAB and have a question about access.</p>
  
  <p>I have three current classes that need to interact with each other. One class, which I'll call main, is what the user will interface with (or the gui if I build one). Main stores all of the pertinent data that the use may want and has a few methods to perform some preprocessing and to construct the main object. Main also calls the constructors for the two other classes.</p>
  
  <p>Another class, I'll call it instruction, loads information about the steps to process the data (this is a recursive process) and some other information.</p>
  
  <p>The final class, which I'll call core, performs the core operations of the process.</p>
  
  <p>Heres what my question is. Within main I have some "helper" methods that are used in the preprocessing. I want the access to these helper methods to be private so that the user cannot see or use them. Some of these helper functions also need to be used by the processes in core. My question is how do I grant access to the helper functions in main so that only main and core can access them? I have tried to understand the information provided here: <a href="http://www.mathworks.com/help/matlab/matlab_oop/selective-access-to-class-methods.html" rel="nofollow">http://www.mathworks.com/help/matlab/matlab_oop/selective-access-to-class-methods.html</a>, but when I try something like:
  </p>
  
  <pre class="lang-matlab prettyprint-override"><code>classdef main &lt; handle
  %this is the main class
      properties
          core  %the core object
          instruction  %the instruction object
      end  %properties
      methods (Access = {?core,?main})
          ... %some code
      end  %methods
  end  %class
  </code></pre>
  
  <p>Matlab gives me this error:</p>
  
  <pre class="lang-matlab prettyprint-override"><code>Illegal value for attribute 'Access'.
  Parameter must be a string.
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Andrew</p>
  
  <p>Btw, I realize that having three different classes is unnecessary here but as I stated I am just learning object oriented programming and when I started this project I thought it would be a good idea to have multiple classes because the total project will be over 5000 lines of code.</p>