<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265339</link>
    <title>MATLAB Central Newsreader - Event-based execution of an M-file in Simulink</title>
    <description>Feed for thread: Event-based execution of an M-file in Simulink</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>Mon, 09 Nov 2009 10:49:02 -0500</pubDate>
      <title>Event-based execution of an M-file in Simulink</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265339#693174</link>
      <author>Laurens </author>
      <description>Depending on the output of a certain block I want to change some parameters in the workspace. So what I want is not really a function but a script.&lt;br&gt;
&lt;br&gt;
If the output of the block is equal to one, I want following commands to be executed:&lt;br&gt;
&lt;br&gt;
set_param('File','SimulationCommand','pause')&lt;br&gt;
rto = get_param('Object','RuntimeObject)&lt;br&gt;
var = rto.OutputPort(1).Data&lt;br&gt;
set_param('File','SimulationCommand','start')&lt;br&gt;
&lt;br&gt;
Basically I pause the simulation and copy the output of block 'Object' in the model 'File' to the variable 'var' in the workspace.&lt;br&gt;
&lt;br&gt;
How can I implement this in Simulink?&lt;br&gt;
&lt;br&gt;
Thank you in advance.</description>
    </item>
  </channel>
</rss>

