title: How to use subsref in MATLAB
body: <p>I use 16a. I found overloading subsref makes any function calls to an object call (). I am not sure if this is the correct use of subsref. For example,</p>
  
  <pre><code>classdef A &lt; handle
      methods
          function obj = A(varargin)
          end
  
          function v = subsref(obj, S) %#ok&lt;STOUT,INUSD&gt;
              assert(false);
          end
  
          function c = foo(obj) %#ok&lt;MANU&gt;
              c = 1;
          end 
      end 
  end
  </code></pre>
  
  <p>Then I god the following errors when using foo.</p>
  
  <pre><code>&gt;&gt; a = A()
  
  a = 
  
    A with no properties.
  
  &gt;&gt; a.foo()
  Error using A/subsref (line 6)
  Assertion failed.
  
  8               assert(false);
  </code></pre>
  
  <p>If I removed subsref, it works fine. In terms of </p>
  
  <p><a href="http://www.mathworks.com/help/matlab/ref/subsref.html" rel="nofollow">http://www.mathworks.com/help/matlab/ref/subsref.html</a></p>
  
  <p>subsref is called only when A{i}, A(i) or A.field. Since foo is a method, why is subsref still called?</p>