<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154393</link>
    <title>MATLAB Central Newsreader - What's the function to compare array elements?</title>
    <description>Feed for thread: What's the function to compare array elements?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 12 Aug 2007 10:26:17 -0400</pubDate>
      <title>What's the function to compare array elements?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154393#387393</link>
      <author>G Iveco</author>
      <description>Basically in my array, if an element is lower than 0.5, set it to 0,&lt;br&gt;
above 0.5, set it to 1.&lt;br&gt;
&lt;br&gt;
Element by element comparison is too time consuming.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 12 Aug 2007 10:35:22 -0400</pubDate>
      <title>Re: What's the function to compare array elements?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154393#387395</link>
      <author>us</author>
      <description>G Iveco:&lt;br&gt;
&amp;lt;SNIP running out of time...&lt;br&gt;
&lt;br&gt;
&amp;gt; if an element is lower than 0.5, set it to 0, above 0.5, &lt;br&gt;
set it to 1...&lt;br&gt;
&lt;br&gt;
one of the solutions&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vr=rand(1,5);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v=vr;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v(v&amp;gt;=.5)=1;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v(v&amp;lt;.5)=0;&lt;br&gt;
% -or- in this particular case&lt;br&gt;
%    v(v~=1)=0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[vr;v]&lt;br&gt;
&lt;br&gt;
us&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 12 Aug 2007 10:36:21 -0400</pubDate>
      <title>Re: What's the function to compare array elements?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154393#387396</link>
      <author>John D'Errico</author>
      <description>"G Iveco" &amp;lt;G.Iveco@google.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;f9mhuo$c8u$1@reader01.singnet.com.sg&amp;gt;...&lt;br&gt;
&amp;gt; Basically in my array, if an element is lower than 0.5, set it to 0,&lt;br&gt;
&amp;gt; above 0.5, set it to 1.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Element by element comparison is too time consuming.&lt;br&gt;
&lt;br&gt;
help round&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
