<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello Chin Luh,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Thanks a lot for your input.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Both cases -- input and output will
      have to be converted --, since the converter is also made to
      convert (sets of) functions definitions, not only scripts.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">About the input case: Steven's answer
      is still not really clear to me. Doing some tests on Octave, we
      must anyway provide some input at calling time when  ~ is used as
      default input in the definition. AFAIU, this ~ could just be to
      make sure that no variable name used inside the function matches
      the name of the input argument in the function definition, since
      "~" alone can't be actually used as variable's name. In this case,
      for Scilab, any input ~ could be replaced with an improbable
      variable name like "%unused" or "%kwzxq", and that should do it.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Please, correct me if someone
      understands something else.<br>
      <br>
      Best regards<br>
      Samuel<br>
    </div>
    <br>
    Le 26/11/2019 à 03:33, Chin Luh Tan a écrit :<br>
    <blockquote type="cite"
cite="mid:16ea58e9d4f.bdf2e66798674.3767031791221590619@bytecode-asia.com">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <div style="font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 10pt;">
        <div>Hi Samuel, <br>
        </div>
        <div><br>
        </div>
        <div>I think your assumption likely correct on the input and the
          output using ~<br>
        </div>
        <div><br>
        </div>
        <div><a
href="https://www.mathworks.com/matlabcentral/answers/288016-tilde-doesn-t-work-for-ignoring-my-inputs"
            target="_blank" moz-do-not-send="true">https://www.mathworks.com/matlabcentral/answers/288016-tilde-doesn-t-work-for-ignoring-my-inputs</a><br>
        </div>
        <div><br>
        </div>
        <div>"<br>
        </div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">You</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">can</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> use tilde to ignore input arguments when you</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">define</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> the function.</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">You</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">cannot</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> use tilde to ignore input arguments when you</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">call</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> the function.</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">You</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">cannot</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> use tilde to ignore output arguments when you</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">define</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> the function.</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">You</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">can</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> use tilde to ignore output arguments when you</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-weight: bold;" class="textBox bold"><span style="box-sizing: border-box;" class="textWrapper">call</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> the function.</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">If you want to be able to specify only the third argument, there must be some way for your function to disambiguate the one-input call from a call that specifies only the third input. Usually in MathWorks function this is done by specifying [] for the arguments for which the user doesn't want to specify. In that case the code would use the default value if either</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;" class="textBox monospace"><span style="box-sizing: border-box;" class="textWrapper">nargin</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> is too small or if</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;" class="textBox monospace"><span style="box-sizing: border-box;" class="textWrapper">nargin</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> is large enough and the specified input argument</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper"> </span></span><span style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;" class="textBox monospace"><span style="box-sizing: border-box;" class="textWrapper">isempty</span></span><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">.</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable"><span style="box-sizing: border-box;" class="textBox"><span style="box-sizing: border-box;" class="textWrapper">"</span></span>
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable">From what I could think off, mat2sci conversion to replace ~ at the output arguments should always be safe. As for the input, since the tilde could not be used as input when calling function, I think there should not be any cases that need to be implemented in conversion? 
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable">Thanks.
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable">Regards,
</div>
        <div style="box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin: 2px 10px 10px 4px; line-height: 1.5; color: rgb(0, 0, 0); font-size: 14px; min-height: 17px; overflow: auto; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;" class="paragraphNode wrappable">CL</div>
        <div><br>
        </div>
        <div data-zbluepencil-ignore="true" style="" class="zmail_extra">
          <div><br>
          </div>
          <div id="Zm-_Id_-Sgn1">---- On Tue, 26 Nov 2019 04:20:52 +0800
            <b>Samuel Gougeon <a class="moz-txt-link-rfc2396E" href="mailto:sgougeon@free.fr"><sgougeon@free.fr></a></b> wrote ----<br>
          </div>
          <div><br>
          </div>
          <blockquote style="border-left: 1px solid rgb(204, 204, 204);
            padding-left: 6px; margin: 0px 0px 0px 5px;">
            <div>
              <div class="x_-2142421898moz-cite-prefix">Le 23/11/2019 à
                15:35, Samuel Gougeon a écrit :<br>
              </div>
              <blockquote>
                <div class="x_-2142421898moz-cite-prefix">Hello<span
                    class="colour" style="color:rgb(0, 0, 0)"> Philipp,
                    and to all (former ;-) matlabers,</span><br>
                </div>
                <div class="x_-2142421898moz-cite-prefix"><span
                    class="colour" style="color:rgb(0, 0, 0)"><br>
                  </span></div>
                <div class="x_-2142421898moz-cite-prefix"><span
                    class="colour" style="color:rgb(0, 0, 0)"></span>Le
                  16/10/2019 à 11:46, P M a écrit :<br>
                </div>
                <blockquote>
                  <div dir="ltr">
                    <div>Dear experts,<br>
                    </div>
                    <div><br>
                    </div>
                    <div>trying to convert a matlab code to scilab I
                      come across following line:<br>
                    </div>
                    <div>
                      <pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(74, 85, 219)">[~</span><span class="colour" style="color:rgb(0, 0, 0)">,~</span><span class="colour" style="color:rgb(0, 0, 0)"></span><span class="colour" style="color:rgb(0, 0, 0)">,</span><span class="colour" style="color:rgb(0, 0, 0)">Minstances_hat</span><span class="colour" style="color:rgb(74, 85, 219)">]</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(0, 0, 0)">unique</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">B</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(255, 170, 0)">:</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;
</span>
</pre>
                      <pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(0, 0, 0)">How to replace the "~" symbol?
</span>
</pre>
                      <pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(0, 0, 0)">B is the blue channel of a RGB image...hence a m x n matrix of integers (type(B) = 8 )
</span>
</pre>
                    </div>
                  </div>
                </blockquote>
                <p><br>
                </p>
                <p>This issue is now reported as <a target="_blank"
                    href="http://bugzilla.scilab.org/show_bug.cgi?id=16254"
                    moz-do-not-send="true">bug 16250</a>.<br>
                </p>
                <p>Solving this issue would improve the converter.<br>
                  I may contribute to solve it. However, I do not use to
                  use Matlab or Octave. So i don't know how the ~
                  placeholder set in the list of <i>inputs</i> is
                  processed inside the called function. This message is
                  a call for information about this topic.<br>
                  <br>
                  Ignoring an output is trivial. As suggested by
                  Stéphane, the ans variable is a good candidate as
                  replacement for ~,<br>
                  just as a fake recipient, as in "[~, ia] =
                  unique(A)"   =>  "[ans, ia] = unique(A)"<br>
                </p>
                <p>The meaning of ignoring an input is a priori
                  completely different, at least from a Scilab point of
                  view.<br>
                </p>
                <p>This leads to the fact that, on the "function ..."
                  line, the converter will have to distinguish the list
                  of inputs from the list of outputs, and then process
                  the same ~ character in 2 different ways.<br>
                  This processing would have to run also when the
                  "function ..." line is split on several rows with the
                  "..." continuation marks.<br>
                  <br>
                  First, i will need an actual example of function call
                  with ~ in the input list, runnable in Octave.<br>
                  Any compact suggestion is welcome.<br>
                  At least 2 use cases are expected: one calling a
                  function written in Octave/Matlab language (improperly
                  called "macros" in Scilab), the other one calling a
                  hard-coded function.<br>
                </p>
                <p>Let's consider the first case, with a "macro":<br>
                </p>
                <ul>
                  <li>What does  the ~ sent placeholder pass to the
                    function? How is it detected/detectable inside the
                    macro ?<br>
                  </li>
                  <li>How is it processed by the function? Is there a
                    generic default processing, as replacing it with the
                    empty matrix [], or whatever else?<br>
                  </li>
                </ul>
              </blockquote>
              <p>Where is the crowd of matlabers?<br>
              </p>
              <div>The page describing this feature:<a target="_blank"
href="https://fr.mathworks.com/help/matlab/matlab_prog/ignore-function-inputs.html"
                  class="x_-2142421898moz-txt-link-freetext"
                  moz-do-not-send="true">https://fr.mathworks.com/help/matlab/matlab_prog/ignore-function-inputs.html</a><br>
              </div>
              <div> But i do not clearly understand it.<br>
              </div>
              <div> Apparently, "canceling" an input is done (only?) at
                the function definition, not when calling it, unlike for
                the outputs.<br>
              </div>
              <div> If so, then <i>ans</i> could also be used as a
                replacement, meaning that anyway this input won't be
                used inside the function.<br>
              </div>
              <div> <br>
              </div>
              <p>A test of call with Octave yields an error:<br>
              </p>
              <p><span class="size" style="font-size:undefinedpx">>>
                  function [r, s] = funtest(a,b,c)<br>
                  end<br>
                  >> funtest(1,~,3)<br>
                  parse error:<br>
                    invalid use of empty argument (~) in index
                  expression<br>
                  >>> funtest(1,~,3)<br>
                                   ^<br>
                  >><br>
                </span></p>
              <div>Any further insight is welcome.<br>
              </div>
              <div> Samuel<br>
              </div>
              <div> <br>
              </div>
              <div> <br>
              </div>
            </div>
            <div>_______________________________________________<br>
            </div>
            <div>users mailing list <br>
            </div>
            <div><a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a> <br>
            </div>
            <div><a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a> <br>
            </div>
          </blockquote>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>