title: Nested class to access other nested class' property
body: <p>I'm looking for a MATLAB solution in which a nested subclass can access the properties of another nested subclass.</p>
  
  <p>In the following example the superclass has two properties which each are initialised as two different subclasses:</p>
  
  <pre><code>classdef superclass
  
    properties
      prop1
      prop2
    end
  
    methods
  
      function obj = superclass()
         obj.prop1 = subclass1;
         obj.prop2 = subclass2;
      end
  
    end
  end
  </code></pre>
  
  <p>The first subclass has the property a:</p>
  
  <pre><code> classdef subclass1
  
      properties
        a
      end
  
   end
  </code></pre>
  
  <p>The second subclass has the property b and a method calcSomething which uses the property a of subclass 1:</p>
  
  <pre><code> classdef subclass2
  
      properties
        b
      end
  
      methods
        function result = calcSomething(obj)
          result = obj.b * superclass.prop1.a;
        end
      end
  
   end
  </code></pre>
  
  <p>How can I express <strong>superclass.prop1.a</strong> to correctly fetch this property from within subclass2?</p>
  
  <p>Thank you! :)</p>
  
  <p>PS I'm not sure if my usage of the words <em>superclass</em> and <em>subclass</em> is entirely correct, since I didn't state</p>
  
  <pre><code>subclass &lt; superclass
  </code></pre>
  
  <p>Maybe the concept of Mother and Children would be more convenient..?!</p>