<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bojan.blog &#187; Scientific Computing</title>
	<atom:link href="http://bojand.org/blog/category/scientific-computing/feed" rel="self" type="application/rss+xml" />
	<link>http://bojand.org/blog</link>
	<description></description>
	<lastBuildDate>Sun, 11 Apr 2010 04:03:46 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create a symmetric matrix in Mathematica</title>
		<link>http://bojand.org/blog/112.html</link>
		<comments>http://bojand.org/blog/112.html#comments</comments>
		<pubDate>Wed, 18 Nov 2009 19:03:20 +0000</pubDate>
		<dc:creator>Bojan</dc:creator>
				<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[mathematica]]></category>

		<guid isPermaLink="false">http://bojan.info/blog/?p=112</guid>
		<description><![CDATA[Here is a quick way to create a symmetric matrix in Mathematica. The code below creates a generic 6&#215;6 matrix (line 1), then mirrors the above-diagonal elements to their below-diagonal counterparts (substitution in lines 3-5).

am = Array[Subscript[a,##] &#38;, {6,6}];
am = am /.
  Flatten[Table[
    Subscript[a,i,j] -&#62; Subscript[a,j,i],
    {i,2,6}, {j,1,i-1}]]

]]></description>
			<content:encoded><![CDATA[<p>Here is a quick way to create a symmetric matrix in Mathematica. The code below creates a generic 6&#215;6 matrix (line 1), then mirrors the above-diagonal elements to their below-diagonal counterparts (substitution in lines 3-5).</p>
<pre class="brush: mathematica;">
am = Array[Subscript[a,##] &amp;, {6,6}];
am = am /.
  Flatten[Table[
    Subscript[a,i,j] -&gt; Subscript[a,j,i],
    {i,2,6}, {j,1,i-1}]]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bojand.org/blog/112.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Function call counting in Matlab</title>
		<link>http://bojand.org/blog/29.html</link>
		<comments>http://bojand.org/blog/29.html#comments</comments>
		<pubDate>Thu, 23 Mar 2006 13:38:15 +0000</pubDate>
		<dc:creator>Bojan</dc:creator>
				<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://blog.bojan.info/?p=29</guid>
		<description><![CDATA[Here&#8217;s a neat way to keep track of the cost, i.e. number of function calls in Matlab: rather than using a counter variable and increment it each time a function is called, use the internal Matlab counters, accessible through the FunctionTable struct array. 
The loop below is necessary only to get the index of the [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat way to keep track of the cost, i.e. number of function calls in Matlab: rather than using a counter variable and increment it each time a function is called, use the internal Matlab counters, accessible through the <kbd>FunctionTable</kbd> struct array. </p>
<p>The loop below is necessary only to get the index of the desired function in the struct array (If you know a better way of looking up a function in <kbd>FunctionTable</kbd>, let me know!).</p>
<p>Replace the function name <kbd>ftest</kbd> if needed.</p>
<pre class="brush: matlab;">
profile on

% your code comes here
% (cost is counted from &quot;profile on&quot; to &quot;profile off&quot;)

p = profile('info');
for i = 1:size(p.FunctionTable,1)
    if strcmp(p.FunctionTable(i).FunctionName,'ftest')
        break
    end
end
cost = p.FunctionTable(i).NumCalls;
profile off
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bojand.org/blog/29.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
