<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848</link>
    <title>MATLAB Central Newsreader - Minimum Value</title>
    <description>Feed for thread: Minimum Value</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by 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>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 19 Aug 2008 22:52:01 -0400</pubDate>
      <title>Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596425</link>
      <author>Raju Gain</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I have a variable which is an array of all positive &lt;br&gt;
numbers. I am trying to find the minimum value in the &lt;br&gt;
varibale other than zero. Can anyone suggest how I can do &lt;br&gt;
this? I was using the min() function before.&lt;br&gt;
&lt;br&gt;
Thanks for your time.</description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 03:38:38 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596447</link>
      <author>bogfrog</author>
      <description>&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a variable which is an array of all positive &lt;br&gt;
&amp;gt; numbers. I am trying to find the minimum value in the&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; varibale other than zero. Can anyone suggest how I&lt;br&gt;
&amp;gt; can do &lt;br&gt;
&amp;gt; this? I was using the min() function before.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for your time.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
min(my_array(find(my_array &amp;gt; 0)))</description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 04:08:01 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596449</link>
      <author>Matt Fig</author>
      <description>By, &quot;All positive values&quot; it seems you are including zero. &lt;br&gt;
So your array has values &amp;gt;0?  There are several ways to&lt;br&gt;
tackle this, here's one that assumes you want to keep a intact:&lt;br&gt;
&lt;br&gt;
a = [0 52 200 13 99 8 2 31 29 10 60 0]; % Data.&lt;br&gt;
&lt;br&gt;
tmp = a;&lt;br&gt;
tmp(tmp==0) = NaN; % Get rid of your zeros.&lt;br&gt;
min(tmp) % The value you want. </description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 06:58:45 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596463</link>
      <author>Walter Roberson</author>
      <description>bogfrog wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; I have a variable which is an array of all positive &lt;br&gt;
&amp;gt;&amp;gt; numbers. I am trying to find the minimum value in the&lt;br&gt;
&amp;gt;&amp;gt; varibale other than zero.&lt;br&gt;
&lt;br&gt;
&amp;gt; min(my_array(find(my_array &amp;gt; 0)))&lt;br&gt;
&lt;br&gt;
The find() step is unnecessary&lt;br&gt;
&lt;br&gt;
min(my_array(my_array &amp;gt; 0))&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Q = quotation(rand);&lt;br&gt;
if isempty(Q); error('Quotation server filesystem problems')&lt;br&gt;
else sprintf('%s',Q), end</description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 07:43:02 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596472</link>
      <author>Paul </author>
      <description>&quot;Raju Gain&quot; &amp;lt;supernova5271@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g8fiqh$1q0$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a variable which is an array of all positive &lt;br&gt;
&amp;gt; numbers. I am trying to find the minimum value in the &lt;br&gt;
&amp;gt; varibale other than zero. Can anyone suggest how I can do &lt;br&gt;
&amp;gt; this? I was using the min() function before.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for your time.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
if x is your array:&lt;br&gt;
&lt;br&gt;
minvalue = min(x((x~=0)))</description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 08:05:09 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596477</link>
      <author>bogfrog</author>
      <description>&amp;gt; The find() step is unnecessary&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; min(my_array(my_array &amp;gt; 0))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks for that.  I thought the 0's in the output of a logical expression would cause an index error.  But obviously not!</description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 09:58:02 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596494</link>
      <author>David </author>
      <description>&quot;Raju Gain&quot; &amp;lt;supernova5271@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g8fiqh$1q0$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a variable which is an array of all positive &lt;br&gt;
&amp;gt; numbers. I am trying to find the minimum value in the &lt;br&gt;
&amp;gt; varibale other than zero. Can anyone suggest how I can &lt;br&gt;
do &lt;br&gt;
&amp;gt; this? I was using the min() function before.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for your time.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
maybe something like:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; a=[0 1 2 3 4 5]&lt;br&gt;
&lt;br&gt;
a =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0     1     2     3     4     5&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; min(a(a&amp;gt;0))&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; </description>
    </item>
    <item>
      <pubDate>Wed, 20 Aug 2008 10:13:23 -0400</pubDate>
      <title>Re: Minimum Value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/234848#596498</link>
      <author>Titus</author>
      <description>&lt;br&gt;
&quot;bogfrog&quot; &amp;lt;jmcgraw@rcn.com&amp;gt; schrieb im Newsbeitrag &lt;br&gt;
news:15362310.1219219539684.JavaMail.jakarta@nitrogen.mathforum.org...&lt;br&gt;
&amp;gt;&amp;gt; The find() step is unnecessary&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; min(my_array(my_array &amp;gt; 0))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for that.  I thought the 0's in the output of a logical expression &lt;br&gt;
&amp;gt; would cause an index error.  But obviously not!&lt;br&gt;
&lt;br&gt;
That is the reason why logicals were added (somewhere around MATLAB 6.0), &lt;br&gt;
false/true is something different then 0/1:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; A = [1 2 3];&lt;br&gt;
&amp;gt;&amp;gt; A([true false true])&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1     3&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; A([1 0 1])&lt;br&gt;
??? Subscript indices must either be real positive integers or logicals.&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; A(A~=2)&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1     3&lt;br&gt;
&lt;br&gt;
This is called &quot;logical indexing&quot;.&lt;br&gt;
&lt;br&gt;
Titus </description>
    </item>
  </channel>
</rss>

