<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 28/12/2016 09:16,
      <a class="moz-txt-link-abbreviated" href="mailto:paul.carrico@free.fr">paul.carrico@free.fr</a> a écrit :<br>
    </div>
    <blockquote cite="mid:037f8fecbcad92365dcad6a1c041e492@free.fr"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div class="pre" style="margin: 0; padding: 0; font-family:
        monospace">Hi all<br>
        <br>
        I do not understand why the following code does not work when I
        try to<br>
        use vectorization (many trials)? <br>
        <br>
        What am I doing wrong ? <br>
        <br>
        Thanks <br>
        <br>
        Paul <br>
        ################################################################
        <br>
        <br>
        mode(0)<br>
        <br>
        A = [ 1 2 9 0 10 6 ; 5 3 8 8 0 9 ; 5 9 1 0 3 9]'<br>
        v = [2 9 6]'<br>
        <br>
        index = zeros(3,1);<br>
        for i = 1 : 3<br>
            index(i) = find(A(:,1) == v(i));<br>
        end<br>
        disp(index)<br>
        <br>
        i = [1 : 3]';<br>
        index2 = zeros(3,1); //pause<br>
        index2(i,1) = find(A(:,1) == v(i,1));<br>
      </div>
    </blockquote>
    <br>
    Actually, what you want and try to do is unclear. Even members()
    could be not appropriate.<br>
    You can easily get an error even with your unvectorized version, as
    soon as one of the v components will appears several times in A(:,1)<br>
    <br>
    SG<br>
    <br>
  </body>
</html>