<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Should min and max Marry?</title>
	<atom:link href="http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-31130</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 03 Mar 2010 19:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-31130</guid>
		<description>John-

I would sort the data and select the first and final 100 values.

--Loren</description>
		<content:encoded><![CDATA[<p>John-</p>
<p>I would sort the data and select the first and final 100 values.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-31128</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 03 Mar 2010 19:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-31128</guid>
		<description>Hi Loren,
Your function is pretty useful for me.
However, what I&#039;m trying to figure out is how to find the first Max.100 values and the minimum 100 values among dataset.
any idea?</description>
		<content:encoded><![CDATA[<p>Hi Loren,<br />
Your function is pretty useful for me.<br />
However, what I&#8217;m trying to figure out is how to find the first Max.100 values and the minimum 100 values among dataset.<br />
any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28294</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 14 Apr 2008 11:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28294</guid>
		<description>Daniel-

Thanks.  I&#039;ve added your suggestion to the enhancement list for consideration.

--Loren</description>
		<content:encoded><![CDATA[<p>Daniel-</p>
<p>Thanks.  I&#8217;ve added your suggestion to the enhancement list for consideration.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Armyr</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28293</link>
		<dc:creator>Daniel Armyr</dc:creator>
		<pubDate>Mon, 14 Apr 2008 11:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28293</guid>
		<description>1) Due to the sheer bulk of data, memory allocation and shuffling is probably the tighter bottleneck, but the variance/mean does take visible time. At this time I have a java implementation to handle these calculations in the time-critical applications, so I can&#039;t provide you with profiling output, unfortunately.

2) Well, if it were documented, I suppose some would find it. I know I looked there before posting here. But I am sure you have usability experts who can answer that question for you.</description>
		<content:encoded><![CDATA[<p>1) Due to the sheer bulk of data, memory allocation and shuffling is probably the tighter bottleneck, but the variance/mean does take visible time. At this time I have a java implementation to handle these calculations in the time-critical applications, so I can&#8217;t provide you with profiling output, unfortunately.</p>
<p>2) Well, if it were documented, I suppose some would find it. I know I looked there before posting here. But I am sure you have usability experts who can answer that question for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28283</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Sun, 13 Apr 2008 11:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28283</guid>
		<description>Daniel-

Congratulations on your new position!  Certainly mean and var could be combined?  I don&#039;t think it would do away with the need for mean, but could be more efficient IF people realized how to best use the new variance to get both.  The question I have for all of these thoughts is 

1) is that really a bottleneck in the code
2) will uses figure it out and find what they need

Thanks for the suggestion.
--Loren</description>
		<content:encoded><![CDATA[<p>Daniel-</p>
<p>Congratulations on your new position!  Certainly mean and var could be combined?  I don&#8217;t think it would do away with the need for mean, but could be more efficient IF people realized how to best use the new variance to get both.  The question I have for all of these thoughts is </p>
<p>1) is that really a bottleneck in the code<br />
2) will uses figure it out and find what they need</p>
<p>Thanks for the suggestion.<br />
&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Armyr</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28258</link>
		<dc:creator>Daniel Armyr</dc:creator>
		<pubDate>Fri, 11 Apr 2008 09:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-28258</guid>
		<description>Hi.
Today I was implementing an algorithm and I came to think of this post and the idea of &quot;marrying&quot; related functions.

In my work I regularly calculate the mean and variance of several hundreds of matrices, each with over a milion elements. Now, this usually runs faster than one might suspect and limited amouts of RAM are generally the big problem.

However, when calculating the variance, one gets the mean as a by-product. Would it be possible for var (or a variant of it) to output the mean as well as the variance? Would it be useful? It would definately be economical.

Sincerely
Daniel Armyr
Newly appointed &quot;Head Matlab Expert&quot; at his department.</description>
		<content:encoded><![CDATA[<p>Hi.<br />
Today I was implementing an algorithm and I came to think of this post and the idea of &#8220;marrying&#8221; related functions.</p>
<p>In my work I regularly calculate the mean and variance of several hundreds of matrices, each with over a milion elements. Now, this usually runs faster than one might suspect and limited amouts of RAM are generally the big problem.</p>
<p>However, when calculating the variance, one gets the mean as a by-product. Would it be possible for var (or a variant of it) to output the mean as well as the variance? Would it be useful? It would definately be economical.</p>
<p>Sincerely<br />
Daniel Armyr<br />
Newly appointed &#8220;Head Matlab Expert&#8221; at his department.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike N</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-27640</link>
		<dc:creator>Mike N</dc:creator>
		<pubDate>Fri, 14 Mar 2008 21:42:52 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-27640</guid>
		<description>I would like to see MATLAB in-lining function calls, in this case, with a bit of optimisation, it would be possible to do both calculations inside a single loop, saving the time, without requiring users to make their code less clear.

A more practical example would be inlining calls to functions coded in MATLAB - making it as efficient (say) to call a function within a loop as to execute the same program with the function hand coded inside the loop.</description>
		<content:encoded><![CDATA[<p>I would like to see MATLAB in-lining function calls, in this case, with a bit of optimisation, it would be possible to do both calculations inside a single loop, saving the time, without requiring users to make their code less clear.</p>
<p>A more practical example would be inlining calls to functions coded in MATLAB &#8211; making it as efficient (say) to call a function within a loop as to execute the same program with the function hand coded inside the loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aslak grinsted</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-27010</link>
		<dc:creator>aslak grinsted</dc:creator>
		<pubDate>Mon, 03 Mar 2008 08:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-27010</guid>
		<description>I&#039;d really like to see a new &quot;range&quot; function giving me both min and max. In my case it is more for convenience than for speed. I really often find my self needing exactly that.</description>
		<content:encoded><![CDATA[<p>I&#8217;d really like to see a new &#8220;range&#8221; function giving me both min and max. In my case it is more for convenience than for speed. I really often find my self needing exactly that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelly</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-26970</link>
		<dc:creator>Kelly</dc:creator>
		<pubDate>Sat, 01 Mar 2008 16:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-26970</guid>
		<description>I have my own version of a minmax function.  I won&#039;t chime in on the speed discussion, since I usually use this function for convenience rather than speed.  My usual use is to equate axis limits (or colormap limits) of several plots.  My minmax returns a single value for min and max regardless of the number of dimensions in the input data.  This way, I can just pass all the y data, or all the xdata, that I plan to plot and figure out what my axis limits need to be, like so:

ax(1) = subplot(2,1,1);
plot(x1,y1);
ax(2) = subplot(2,1,2);
plot(x2, y2);
set(ax, &#039;ylim&#039;, minmax([y1 y2]));

It&#039;s perhaps a trivial use, but I use it pretty often.</description>
		<content:encoded><![CDATA[<p>I have my own version of a minmax function.  I won&#8217;t chime in on the speed discussion, since I usually use this function for convenience rather than speed.  My usual use is to equate axis limits (or colormap limits) of several plots.  My minmax returns a single value for min and max regardless of the number of dimensions in the input data.  This way, I can just pass all the y data, or all the xdata, that I plan to plot and figure out what my axis limits need to be, like so:</p>
<p>ax(1) = subplot(2,1,1);<br />
plot(x1,y1);<br />
ax(2) = subplot(2,1,2);<br />
plot(x2, y2);<br />
set(ax, &#8216;ylim&#8217;, minmax([y1 y2]));</p>
<p>It&#8217;s perhaps a trivial use, but I use it pretty often.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-26944</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 29 Feb 2008 15:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/02/27/should-min-and-max-marry/#comment-26944</guid>
		<description>Folks-

Much food for thought here and I thank you for it.  I will mention just a couple of points.

I was trying to see how common the combined use of min and max are.  I still don&#039;t know if I have a feel for that.  I was also trying to understand how big a portion of your overall algorithms were dominated by the calls to min and max vs. spending time doing lots of other stuff as well.  My guess is that min and max, while perhaps taking some time, would not be dominant in most of your application profile reports.  But again, I don&#039;t know.

We do often have to decide in a design what to do for large for small data sizes because as Tim mentioned, algorithms can be dominated by computer architecture, etc.

As for readability, I am not sure that minAndMax, or whatever name might be used, we be much less readible than calling min and then max.  Sometimes the function names do help out.  Still I understand the desire for readability and applaud it totally.

Thanks again for chiming in!
--Loren</description>
		<content:encoded><![CDATA[<p>Folks-</p>
<p>Much food for thought here and I thank you for it.  I will mention just a couple of points.</p>
<p>I was trying to see how common the combined use of min and max are.  I still don&#8217;t know if I have a feel for that.  I was also trying to understand how big a portion of your overall algorithms were dominated by the calls to min and max vs. spending time doing lots of other stuff as well.  My guess is that min and max, while perhaps taking some time, would not be dominant in most of your application profile reports.  But again, I don&#8217;t know.</p>
<p>We do often have to decide in a design what to do for large for small data sizes because as Tim mentioned, algorithms can be dominated by computer architecture, etc.</p>
<p>As for readability, I am not sure that minAndMax, or whatever name might be used, we be much less readible than calling min and then max.  Sometimes the function names do help out.  Still I understand the desire for readability and applaud it totally.</p>
<p>Thanks again for chiming in!<br />
&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

