title: Input argument "c" is undefined, How to pass c to foo2() ? [matlab]
body: <p>I have the following code:</p>
  
  <pre><code>classdef ClassA
  
  properties
      A;
      B;
  
  end
  
  methods
  function obj = ClassA(A,B)
  
      obj.A = 1;
      obj.B = 2;
      obj.foo1();
  
  end
   function c = foo1(obj,A,B)
  
      c = obj.A+obj.B;
      obj.foo2()
  
   end
   function foo2(obj,c,A)
       disp(c);
       disp(obj.A);
  
   end
  
  end
  end
  </code></pre>
  
  <p>I am trying to get the value of variable c from foo1(obj,A,B), and pass to foo2(obj,c,A), when I do so, I get the following error:</p>
  
  <pre><code>Input argument "c" is undefined.
  </code></pre>
  
  <p>I tried to solve it by write foo2 in this way:</p>
  
  <pre><code>foo2(c,A)
  </code></pre>
  
  <p>then I got this:</p>
  
  <pre><code>Undefined variable "obj" or class "obj.A"
  </code></pre>
  
  <p>I would be grateful if you could help me.</p>