<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><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">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><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">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><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">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><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 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><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">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><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">"</span></span><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">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? <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">Thanks.<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">Regards,<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">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 <sgougeon@free.fr></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><br></pre><pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(0, 0, 0)">How to replace the "~" symbol?
</span><br></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><br></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">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">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>users@lists.scilab.org <br></div><div>http://lists.scilab.org/mailman/listinfo/users <br></div></blockquote></div><div><br></div></div><br></body></html>