<?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: The If-Else Construct in Models</title>
	<atom:link href="http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/</link>
	<description>This blog is about Simulink.</description>
	<lastBuildDate>Fri, 17 Feb 2012 15:36:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Seth Popinchalk</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-1597</link>
		<dc:creator>Seth Popinchalk</dc:creator>
		<pubDate>Thu, 03 Nov 2011 20:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-1597</guid>
		<description>@Orucn - the Unit Delay represents a state in the system.  States upstream of an switch block should not be optimized as the state still needs to update, no matter what the value of the switch.  If you want it to execute differently, it would be better to explicitly model the conditional behavior.  There is an example of this in the post titled &lt;a href=&quot;http://blogs.mathworks.com/seth/2009/08/20/a-better-if-else-construct/&quot; rel=&quot;nofollow&quot;&gt;A Better If-Else Construct&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Orucn &#8211; the Unit Delay represents a state in the system.  States upstream of an switch block should not be optimized as the state still needs to update, no matter what the value of the switch.  If you want it to execute differently, it would be better to explicitly model the conditional behavior.  There is an example of this in the post titled <a href="http://blogs.mathworks.com/seth/2009/08/20/a-better-if-else-construct/" rel="nofollow">A Better If-Else Construct</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orcun</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-1595</link>
		<dc:creator>Orcun</dc:creator>
		<pubDate>Tue, 01 Nov 2011 12:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-1595</guid>
		<description>What if there is a unit delay or so in an input branch. Will the optimization work correct? Or just do the optimization for the part of the branch which is after the unit delay?</description>
		<content:encoded><![CDATA[<p>What if there is a unit delay or so in an input branch. Will the optimization work correct? Or just do the optimization for the part of the branch which is after the unit delay?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-846</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Fri, 11 Sep 2009 14:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-846</guid>
		<description>@HansUS - Notice that both sides of the IF statement reference the same temporary variable, in this case named rtb_in2.  I think you are suggesting that it would be more efficient to directly write to the out variable, and you are correct.  The reason this model doesn&#039;t do that is because I disabled the expression folding optimization.  The model is so simple that with expression folding turned on, both codes were the same.  Please see important note 1 above.  Thanks for the comment.</description>
		<content:encoded><![CDATA[<p>@HansUS &#8211; Notice that both sides of the IF statement reference the same temporary variable, in this case named rtb_in2.  I think you are suggesting that it would be more efficient to directly write to the out variable, and you are correct.  The reason this model doesn&#8217;t do that is because I disabled the expression folding optimization.  The model is so simple that with expression folding turned on, both codes were the same.  Please see important note 1 above.  Thanks for the comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HansUS</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-845</link>
		<dc:creator>HansUS</dc:creator>
		<pubDate>Fri, 11 Sep 2009 13:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-845</guid>
		<description>I wonder if the pseudo code on the right is correct.
Copy and paste mistake?

Without the Signal storage reuse option set,
the if-branch should use rtb_in1 instead of rtb_in2.

With activated Signal storage reuse option,
both if- and else-branch should directly write to the out variable.</description>
		<content:encoded><![CDATA[<p>I wonder if the pseudo code on the right is correct.<br />
Copy and paste mistake?</p>
<p>Without the Signal storage reuse option set,<br />
the if-branch should use rtb_in1 instead of rtb_in2.</p>
<p>With activated Signal storage reuse option,<br />
both if- and else-branch should directly write to the out variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramin</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-823</link>
		<dc:creator>Ramin</dc:creator>
		<pubDate>Wed, 12 Aug 2009 18:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-823</guid>
		<description>Can this be used to pass in a large structure, then after the first pass, not have the large structure as input?
Like a Data File which gets passed in once, and then not looked passed in after that? 

Does this just impact the generated code, or does the Matlab/Simulink Internals fetch the data anyways before the assignments in the code? I&#039;d like to have a selector &quot;first_time_called&quot; then not have the input get copied since it won&#039;t change after the first call in generated code or simulink engine. (Note: values in the file are not known until run time so it can&#039;t be hard coded)</description>
		<content:encoded><![CDATA[<p>Can this be used to pass in a large structure, then after the first pass, not have the large structure as input?<br />
Like a Data File which gets passed in once, and then not looked passed in after that? </p>
<p>Does this just impact the generated code, or does the Matlab/Simulink Internals fetch the data anyways before the assignments in the code? I&#8217;d like to have a selector &#8220;first_time_called&#8221; then not have the input get copied since it won&#8217;t change after the first call in generated code or simulink engine. (Note: values in the file are not known until run time so it can&#8217;t be hard coded)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-811</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Tue, 21 Jul 2009 17:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-811</guid>
		<description>@Anand Rangaramu - I hope you can turn on this optimization, but I think you should also strive to add explicit specifications of conditional behavior to your model.  Stay tuned for a post on that.</description>
		<content:encoded><![CDATA[<p>@Anand Rangaramu &#8211; I hope you can turn on this optimization, but I think you should also strive to add explicit specifications of conditional behavior to your model.  Stay tuned for a post on that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anand Rangaramu</title>
		<link>http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-773</link>
		<dc:creator>Anand Rangaramu</dc:creator>
		<pubDate>Fri, 12 Jun 2009 16:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2009/06/02/the-if-else-construct-in-models/#comment-773</guid>
		<description>This is great. We need to implement this in our code.</description>
		<content:encoded><![CDATA[<p>This is great. We need to implement this in our code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

