title: How to get binary output for unique()?
body: <p><code>[uniq_elements,uniq_indices]=unique(x)</code> </p>
  
  <p>shows unique element in e.g. vector <code>x</code>. </p>
  
  <p>What would be a simple (i.e. one-liner) and efficient(i.e. fast execution time) way to simply and only indicate 'is this value unique or not' and 'if not' output the first of the series of duplicates? Is there maybe a way to solve this using logical operators? It could be a start to simply have a function outputting 'is this value unique or not'. </p>
  
  <p>example code:</p>
  
  <pre><code>x=[5 5 2 2 3 4 4 1 1 1]; %example values
  [~,uniq_indices]=unique(x); %returns [1,3,5,6,8]
  result=false(size(x));
  result(uniq_indices)=1
  %console ouput:
  result =
  
    1×10 logical array
  
     1   0   1   0   1   1   0   1   0   0
  </code></pre>
  
  <p>Basically my presumption is that - because only logical output is needed - the above code could be achieved faster/easier.</p>