<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Sorry, in my answer the loop constructs "ic", not  "ia", i.e. the
      full equivalent to Matlab's "[C,ia,ic] = unique(A)" is in Scilab:<br>
    </p>
    <p>[C,ia] = unique(A)<br>
      for i=1:length(A)<br>
          ic(i)=find(A(i)==C)<br>
      end</p>
    <p>S.<br>
    </p>
    <div class="moz-cite-prefix">Le 16/10/2019 à 13:19, Stéphane
      Mottelet a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:fed046c1-20b4-2df6-d391-2e6b824a2a29@utc.fr">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>Sorry, I thought you were just asking about the tildas, not the
        syntax of unique() in Scilab.</p>
      <p>Please see</p>
      <p><a class="moz-txt-link-freetext"
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/help.scilab.org/docs/6.0.2/en_US/unique.html"
          moz-do-not-send="true">https://help.scilab.org/docs/6.0.2/en_US/unique.html</a></p>
      <p>vs</p>
      <p><a class="moz-txt-link-freetext"
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/fr.mathworks.com/help/matlab/ref/unique.html"
          moz-do-not-send="true">https://fr.mathworks.com/help/matlab/ref/unique.html</a></p>
      <p>Matlab syntax [C,ia,ic] = unique(___)  with 3 outputs has no
        equivalent in Scilab. i.e. in Matlab, after  [C,ia,ic] =
        unique(A) then A=C(ic), i.e. values in ic are the indices of
        corresponding unique value in C.  They can be recovered with the
        quick and dirty following loop:</p>
      <p>for i=1:length(a)<br>
             ia(i)=find(a(i)==C)<br>
        end<br>
      </p>
      <div class="moz-cite-prefix">S.</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">Le 16/10/2019 à 12:10, P M a écrit :<br>
      </div>
      <blockquote type="cite"
cite="mid:CACf7ODtu3kcCa4k72w=jg+gYqxD7Wuhox+Me-Bqg4aeZ0dbA_w@mail.gmail.com">
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <div dir="ltr">
          <div><span style="color:rgb(74,85,219)">[ans</span><span
              style="color:rgb(0,0,0)">,</span><span
              style="color:rgb(0,0,0)"></span><span
              style="color:rgb(0,0,0)">ans,</span><span
              style="color:rgb(0,0,0)">Minstances_hat</span><span
              style="color:rgb(74,85,219)">]</span> <span
              style="color:rgb(92,92,92)">=</span> <span
              style="color:rgb(0,0,0)">unique</span><span
              style="color:rgb(74,85,219)">(</span><span
              style="color:rgb(0,0,0)">B</span><span
              style="color:rgb(74,85,219)">(</span><span
              style="color:rgb(255,170,0)">:</span><span
              style="color:rgb(74,85,219)">)</span><span
              style="color:rgb(74,85,219)">)</span><span
              style="color:rgb(0,0,0)">;</span> <br>
          </div>
          <div>gives:  Wrong number of output arguments.</div>
          <div><br>
          </div>
          <div>I also tried :</div>
          <div>
            <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(74,85,219)">[</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(74,85,219)">]</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">unique</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span></pre>
            <span style="color:rgb(74,85,219)"></span></div>
          <div>and get a vector.</div>
          <div>also <br>
          </div>
          <div><span style="color:rgb(74,85,219)"></span><span
              style="color:rgb(74,85,219)"></span> </div>
          <div>
            <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(74,85,219)">[</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">index</span><span style="color:rgb(74,85,219)">]</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">unique</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span></pre>
            <span style="color:rgb(74,85,219)"></span></div>
          <div><span style="color:rgb(0,0,0)">seem to work.<br>
            </span> </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>However afterwards there is this line: <br>
            <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(92,92,92)">masks =</span> reshape<span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(92,92,92)">-</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(50,185,185)">size</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span></pre>
          </div>
          <div>I try to convert via: <br>
          </div>
          <div>
            <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">mask</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">matrix</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(92,92,92)">-</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(50,185,185)">size</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span></pre>
          </div>
          <div>but no success.</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">Am Mi., 16. Okt. 2019 um
              11:50 Uhr schrieb Stéphane Mottelet <<a
                href="mailto:stephane.mottelet@utc.fr"
                moz-do-not-send="true">stephane.mottelet@utc.fr</a>>:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF">
                <p>Hello<br>
                </p>
                <div>Le 16/10/2019 à 11:46, P M a écrit :<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>Dear experts,</div>
                    <div><br>
                    </div>
                    <div>trying to convert a matlab code to scilab I
                      come across following line:</div>
                    <div>
                      <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(74,85,219)">[~</span><span style="color:rgb(0,0,0)">,~</span><span style="color:rgb(0,0,0)"></span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(74,85,219)">]</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">unique</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;
</span></pre>
                      <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">How to replace the "~" symbol?
</span></pre>
                    </div>
                  </div>
                </blockquote>
                <p>by dummy names, e.g.</p>
                <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(74,85,219)">[ans</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)"></span><span style="color:rgb(0,0,0)">ans,</span><span style="color:rgb(0,0,0)">Minstances_hat</span><span style="color:rgb(74,85,219)">]</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">unique</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">B</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)"></span><span style="color:rgb(0,0,0)">;

There is no equivalent mechanism in Scilab.
</span></pre>
              </div>
            </blockquote>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF">
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>
                      <pre style="font-family:Monospaced;font-style:normal"><span 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>
                      <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">
Thank you,
</span></pre>
                      <pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">Philipp
</span></pre>
                    </div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank" moz-do-not-send="true">users@lists.scilab.org</a>
<a href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" target="_blank" moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
                </blockquote>
                <pre cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.utc.fr/~mottelet" target="_blank" moz-do-not-send="true">http://www.utc.fr/~mottelet</a>
</pre>
              </div>
              _______________________________________________<br>
              users mailing list<br>
              <a href="mailto:users@lists.scilab.org" target="_blank"
                moz-do-not-send="true">users@lists.scilab.org</a><br>
              <a
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.scilab.org/mailman/listinfo/users</a><br>
            </blockquote>
          </div>
        </div>
        <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" moz-do-not-send="true">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
      </blockquote>
      <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.utc.fr/~mottelet" moz-do-not-send="true">http://www.utc.fr/~mottelet</a>
</pre>
      <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="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a>
</pre>
  </body>
</html>