title: Side effects of calling a MATLAB class instance don't persist
body: <p>If I make the following toy class in MATLAB:</p>
  
  <pre><code>classdef testIt
      properties
          a
          b
          c
      end
      methods
          function obj = testIt
              obj.a = 1;
              obj.b = 2;
          end
  
          function obj = set.a(obj,a)
              obj.a = a;
          end
  
          function obj = set.b(obj,b)
              obj.b = b;
          end
  
          function obj = addup(obj)
              obj.c = obj.a + obj.b;
          end
      end
  end
  </code></pre>
  
  <p>and then instantiate and call the <code>addup</code> method:</p>
  
  <pre><code>&gt;&gt; aTest = testIt
  
  Properties:
  a: 1
  b: 2
  c: []
  
  &gt;&gt; aTest.addup
  
  Properties:
  a: 1
  b: 2
  c: 3
  
  &gt;&gt; aTest
  
  Properties:
  a: 1
  b: 2
  c: []
  </code></pre>
  
  <p>The property <code>c</code> has not been created. Instead, I need to use the syntax:</p>
  
  <pre><code>&gt;&gt; aTest = aTest.addup
  
  &gt;&gt; aTest
  
  Properties:
  a: 1
  b: 2
  c: 3
  </code></pre>
  
  <p>Can anyone explain to me why this is necessary?</p>