<?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 for Loren on the Art of MATLAB</title>
	<atom:link href="http://blogs.mathworks.com/loren/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren</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>Wed, 08 May 2013 12:21:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Yair Altman</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-37004</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Wed, 08 May 2013 12:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-37004</guid>
		<description>Nick - perhaps this is due to vec(:) being processed entirely in-place, whereas sub-indexing requires allocating a new memory block, and later deallocating it. It is also possible that JIT is able to vectorize the first but not the second. Both of these are educated guesses, and do not rely on anything official - I may well be wrong here.

See related http://undocumentedmatlab.com/blog/matrix-processing-performance/</description>
		<content:encoded><![CDATA[<p>Nick &#8211; perhaps this is due to vec(:) being processed entirely in-place, whereas sub-indexing requires allocating a new memory block, and later deallocating it. It is also possible that JIT is able to vectorize the first but not the second. Both of these are educated guesses, and do not rely on anything official &#8211; I may well be wrong here.</p>
<p>See related <a href="http://undocumentedmatlab.com/blog/matrix-processing-performance/" rel="nofollow">http://undocumentedmatlab.com/blog/matrix-processing-performance/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Loren Shure</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36981</link>
		<dc:creator>Loren Shure</dc:creator>
		<pubDate>Wed, 08 May 2013 05:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36981</guid>
		<description>Nick-

We have made a concerted effort to improve the loop performance in MATLAB over the years.  So I don&#039;t think it&#039;s necessary to always avoid them.

I do think you should be careful about programming to the performance details of any given MATLAB release.  We are always looking for opportunities to improve performance, and you may well find that something that used to be the fastest way, while not degraded in performance, becomes less compelling if we manage to speed up a different strategy.  I would always emphasize writing code that is readable, maintainable, and does what you mean for it do.  

--Loren</description>
		<content:encoded><![CDATA[<p>Nick-</p>
<p>We have made a concerted effort to improve the loop performance in MATLAB over the years.  So I don&#8217;t think it&#8217;s necessary to always avoid them.</p>
<p>I do think you should be careful about programming to the performance details of any given MATLAB release.  We are always looking for opportunities to improve performance, and you may well find that something that used to be the fastest way, while not degraded in performance, becomes less compelling if we manage to speed up a different strategy.  I would always emphasize writing code that is readable, maintainable, and does what you mean for it do.  </p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Nick</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36970</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 07 May 2013 18:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36970</guid>
		<description>Loren,
This paves the way for a question I have been wanting to ask you:
Because the JIT has gotten so good at accelerating loops do you think that there should be less of an emphasis on vectorization of code?  Recently I have been writing some low level functions that need to be very fast, and repeatedly I have found that a looped implementation ( assuming you can get all &quot;if statements&quot; out of the loop) are the fastest solution.

Also can you can you comment on the speed of sub array code which uses continuous sub indexes?  I have found that vec(:)=vec(:).*3   is much faster that vec(1:10)=vec(1:10).*3  even if vec 100+ elements.  This come up when you preallocate array space without knowing exactly how much you will use.  And while vec(:)=vec(:).*3 work it just seems wasteful to me when I only need to do it to the first x elements.</description>
		<content:encoded><![CDATA[<p>Loren,<br />
This paves the way for a question I have been wanting to ask you:<br />
Because the JIT has gotten so good at accelerating loops do you think that there should be less of an emphasis on vectorization of code?  Recently I have been writing some low level functions that need to be very fast, and repeatedly I have found that a looped implementation ( assuming you can get all &#8220;if statements&#8221; out of the loop) are the fastest solution.</p>
<p>Also can you can you comment on the speed of sub array code which uses continuous sub indexes?  I have found that vec(:)=vec(:).*3   is much faster that vec(1:10)=vec(1:10).*3  even if vec 100+ elements.  This come up when you preallocate array space without knowing exactly how much you will use.  And while vec(:)=vec(:).*3 work it just seems wasteful to me when I only need to do it to the first x elements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Andrew</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36940</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Mon, 06 May 2013 14:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36940</guid>
		<description>I often think of array indexing as effectively being a function call. In general you want to minimize the number of function calls. Just don&#039;t over do it and let Matlab&#039;s JIT do it&#039;s thing for the most part.</description>
		<content:encoded><![CDATA[<p>I often think of array indexing as effectively being a function call. In general you want to minimize the number of function calls. Just don&#8217;t over do it and let Matlab&#8217;s JIT do it&#8217;s thing for the most part.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Loren Shure</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36926</link>
		<dc:creator>Loren Shure</dc:creator>
		<pubDate>Sun, 05 May 2013 18:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36926</guid>
		<description>Jonas-

Thanks for mentioning the other post.  I believe this situation is completely different (but I could be wrong).  Here it&#039;s a question of how many times you create the submatrix, 1 or n.

--Loren</description>
		<content:encoded><![CDATA[<p>Jonas-</p>
<p>Thanks for mentioning the other post.  I believe this situation is completely different (but I could be wrong).  Here it&#8217;s a question of how many times you create the submatrix, 1 or n.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Jonas</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36924</link>
		<dc:creator>Jonas</dc:creator>
		<pubDate>Sun, 05 May 2013 15:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36924</guid>
		<description>There was recently quite a bit of discussion regarding some puzzling observations with indexing on Stackoverflow: (http://stackoverflow.com/questions/13382155/is-indexing-vectors-in-matlab-inefficient).</description>
		<content:encoded><![CDATA[<p>There was recently quite a bit of discussion regarding some puzzling observations with indexing on Stackoverflow: (<a href="http://stackoverflow.com/questions/13382155/is-indexing-vectors-in-matlab-inefficient" rel="nofollow">http://stackoverflow.com/questions/13382155/is-indexing-vectors-in-matlab-inefficient</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Rodrigo</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36909</link>
		<dc:creator>Rodrigo</dc:creator>
		<pubDate>Sat, 04 May 2013 23:07:48 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36909</guid>
		<description>Just learned something, thanks!</description>
		<content:encoded><![CDATA[<p>Just learned something, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Recent Question about Speed with Subarray Calculations by Yair Altman</title>
		<link>http://blogs.mathworks.com/loren/2013/05/04/recent-question-about-speed-with-subarray-calculations/#comment-36908</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Sat, 04 May 2013 21:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=688#comment-36908</guid>
		<description>This technique is often called &quot;loop-invariant hoisting&quot; or &quot;loop-invariant code-motion&quot; (http://en.wikipedia.org/wiki/Loop-invariant_code_motion)

Some modern compilers are able to automatically identify and optimize such cases, but apparently Matlab&#039;s JIT/accelerator is not as smart. Maybe one day...</description>
		<content:encoded><![CDATA[<p>This technique is often called &#8220;loop-invariant hoisting&#8221; or &#8220;loop-invariant code-motion&#8221; (<a href="http://en.wikipedia.org/wiki/Loop-invariant_code_motion" rel="nofollow">http://en.wikipedia.org/wiki/Loop-invariant_code_motion</a>)</p>
<p>Some modern compilers are able to automatically identify and optimize such cases, but apparently Matlab&#8217;s JIT/accelerator is not as smart. Maybe one day&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MATLAB to FPGA using HDL Coder(TM) by Kiran Kintali</title>
		<link>http://blogs.mathworks.com/loren/2013/04/11/matlab-to-fpga-using-hdl-codertm/#comment-36851</link>
		<dc:creator>Kiran Kintali</dc:creator>
		<pubDate>Fri, 03 May 2013 14:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=673#comment-36851</guid>
		<description>Hi Pavan,

Can you give us more details about your request? What do you eman by adding ports to HDL file? 

Have you seen the example? &quot;Verify Sobel Edge Detection Algorithm in MATLAB-to-HDL Workflow&quot;

It illustrates how to debug algorithm written in MATLAB in the loop with FPGA in MATLAB to HDL workflow advisor.

&gt;&gt; which cosim_fil_sobel.m</description>
		<content:encoded><![CDATA[<p>Hi Pavan,</p>
<p>Can you give us more details about your request? What do you eman by adding ports to HDL file? </p>
<p>Have you seen the example? &#8220;Verify Sobel Edge Detection Algorithm in MATLAB-to-HDL Workflow&#8221;</p>
<p>It illustrates how to debug algorithm written in MATLAB in the loop with FPGA in MATLAB to HDL workflow advisor.</p>
<p>&gt;&gt; which cosim_fil_sobel.m</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MATLAB to FPGA using HDL Coder(TM) by Pavan</title>
		<link>http://blogs.mathworks.com/loren/2013/04/11/matlab-to-fpga-using-hdl-codertm/#comment-36791</link>
		<dc:creator>Pavan</dc:creator>
		<pubDate>Thu, 02 May 2013 07:36:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=673#comment-36791</guid>
		<description>Hey,
Is there a way through which i can add ports into the HDL file generated using HDL workflow advisor in MATLAB and assign a value to it. I need it to verify the output of the design in FPGA.
Thank You</description>
		<content:encoded><![CDATA[<p>Hey,<br />
Is there a way through which i can add ports into the HDL file generated using HDL workflow advisor in MATLAB and assign a value to it. I need it to verify the output of the design in FPGA.<br />
Thank You</p>
]]></content:encoded>
	</item>
</channel>
</rss>
