<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 08/11/2016 20:41, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote cite="mid:58222A7C.7050606@free.fr" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix"><font color="#009900">Hello Shamika,<br>
          <font size="2">.../...</font></font><font size="2"><span
            style="font-family:monospace,monospace"><font size="2"><span
                style="font-family:monospace,monospace"><br>
              </span></font></span></font>Le 08/11/2016 06:47, Shamika
        Mohanan a écrit :<br>
      </div>
      <font size="2">.../...<br>
      </font>Now when I call this function with <span
        style="font-family:monospace,monospace">[c,d]=callOct("butter",8,0.1)</span>,
      I get no error. <br>
      <blockquote
cite="mid:CAHbxmFRr0bw7urTDn0CHa-CoA4aJCQOw6kSgPzhGkZ6cQ+TfbA@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div>
            <div>
              <div><font size="2"> <br>
                </font></div>
              <font size="2">I need callOct function to work with any
                number of output arguments and so I need to use
                varargout. How do I get the function to work with
                varargout?<br>
              </font></div>
          </div>
        </div>
      </blockquote>
      <font size="2">.<br>
        <font color="#009900"><big>To answer, you must provide
            information about how you define  </big></font></font><font
        color="#009900"><big><font size="2"><big><span
                style="font-family:monospace,monospace">callOctave(<wbr>fname,varargin):<br>
              </span></big></font><font size="2"><big>Does it use also
              varargout, or not?<br>
            </big></font></big></font></blockquote>
    <font color="#009900"><font size="2">.<br>
        Here is an example:</font></font><br>
    <pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">L</span><span style="color:rgb(92,92,92);"> = </span><span style="color:rgb(0,0,0);text-decoration:underline;">test</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>                    // using a simple list not named varargout as single argout does the job
     <span style="color:rgb(131,67,16);font-weight:bold;">L</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">list</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(218,112,214);">%z</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(218,112,214);">%pi</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(218,112,214);">%t</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">abc</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(176,24,19);">endfunction</span>

<span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">varargout</span><span style="color:rgb(92,92,92);"> = </span><span style="color:rgb(0,0,0);text-decoration:underline;">main</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
    <span style="color:rgb(131,67,16);font-weight:bold;">varargout</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);text-decoration:underline;">test</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(176,24,19);">endfunction

<font color="#000000"><tt>-->[a,b] = main()</tt><tt>
</tt><tt> b  =</tt><tt>
</tt><tt>    3.1415927  </tt><tt>
</tt><tt> a  =</tt><tt>
</tt><tt>    z   </tt><tt>
</tt><tt> </tt><tt>
</tt><tt>-->[a,b,c] = main()</tt><tt>
</tt><tt> c  =</tt><tt>
</tt><tt>  T  </tt><tt>
</tt><tt> b  =</tt><tt>
</tt><tt>    3.1415927  </tt><tt>
</tt><tt> a  =</tt><tt>
</tt><tt>    z   </tt><tt>
</tt></font>
<font color="#009900">Samuel
</font>
</span></pre>
  </body>
</html>