<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881</link>
    <title>MATLAB Central Newsreader - Scope of 'To Workspace' variables</title>
    <description>Feed for thread: Scope of 'To Workspace' variables</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>Sun, 25 May 2008 21:01:02 -0400</pubDate>
      <title>Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#433945</link>
      <author>Hans Gohle</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I have a model that contains several 'To Workspace' outputs.&lt;br&gt;
The execution of the model is done within a function and&lt;br&gt;
therefore these variables are only visible within that&lt;br&gt;
function. &lt;br&gt;
&lt;br&gt;
But I need all these variables in the workspace as they are&lt;br&gt;
needed by a GUI that is executed concurrently and plots the&lt;br&gt;
data from the model. What is the best way to share the data&lt;br&gt;
between the model and the GUI?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
g.</description>
    </item>
    <item>
      <pubDate>Mon, 26 May 2008 23:21:42 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434143</link>
      <author>Ralph Schleicher</author>
      <description>&quot;Hans Gohle&quot; &amp;lt;ghostryder@gmx.de&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; I have a model that contains several 'To Workspace' outputs.&lt;br&gt;
&amp;gt; The execution of the model is done within a function and&lt;br&gt;
&amp;gt; therefore these variables are only visible within that&lt;br&gt;
&amp;gt; function. &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But I need all these variables in the workspace as they are&lt;br&gt;
&amp;gt; needed by a GUI that is executed concurrently and plots the&lt;br&gt;
&amp;gt; data from the model. What is the best way to share the data&lt;br&gt;
&amp;gt; between the model and the GUI?&lt;br&gt;
&lt;br&gt;
Do you look for somethink like that:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
function a_function&lt;br&gt;
&amp;nbsp;&amp;nbsp;sim('a_model');&lt;br&gt;
&amp;nbsp;&amp;nbsp;% Propagate workspace variables.&lt;br&gt;
&amp;nbsp;&amp;nbsp;my_gui('sim-data', a, b, c);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
function my_gui(varargin)&lt;br&gt;
&amp;nbsp;&amp;nbsp;switch varargin{1}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;case 'sim-data'&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a = varargin{2};&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b = varargin{3};&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = varargin{4};&lt;br&gt;
&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Ralph Schleicher, Freelance Engineer    &lt;a href=&quot;http://ralph-schleicher.de&quot;&gt;http://ralph-schleicher.de&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Development * Consulting * Training&lt;br&gt;
Mathematical Modeling and Simulation&lt;br&gt;
Software Tools</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 07:54:02 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434183</link>
      <author>Hans Gohle</author>
      <description>Ralph Schleicher &amp;lt;rs@ralph-schleicher.de&amp;gt; wrote in message&lt;br&gt;
&amp;lt;87iqx0mz21.fsf@echo.mueller-schleicher.i&amp;gt;...&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; Do you look for somethink like that:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function a_function&lt;br&gt;
&amp;gt;   sim('a_model');&lt;br&gt;
&amp;gt;   % Propagate workspace variables.&lt;br&gt;
&amp;gt;   my_gui('sim-data', a, b, c);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function my_gui(varargin)&lt;br&gt;
&amp;gt;   switch varargin{1}&lt;br&gt;
&amp;gt;    case 'sim-data'&lt;br&gt;
&amp;gt;     a = varargin{2};&lt;br&gt;
&amp;gt;     b = varargin{3};&lt;br&gt;
&amp;gt;     c = varargin{4};&lt;br&gt;
&amp;gt;   end&lt;br&gt;
&lt;br&gt;
I'm sorry but I don't think that I have stated my problem&lt;br&gt;
correctly. I'll give it one more try: &lt;br&gt;
&lt;br&gt;
I'm executing a model in 'scope' mode which means that I set&lt;br&gt;
the simulation time to 'inf'. In that model there are&lt;br&gt;
several 'To Workspace' variables. The problem is that I need&lt;br&gt;
the values of these blocks during the simulation time. &lt;br&gt;
&lt;br&gt;
So I need any mechanism with that I can forward the&lt;br&gt;
simulation data to my GUI during the simulation itself. &lt;br&gt;
&lt;br&gt;
Hopefully I described my problem a bit better...&lt;br&gt;
&lt;br&gt;
Thanks, g. </description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 11:25:03 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434223</link>
      <author>helper </author>
      <description>I'm not sure I follow exactly, but maybe the ASSIGNIN and &lt;br&gt;
EVALIN functions would help you?</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 11:47:02 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434227</link>
      <author>Hans Gohle</author>
      <description>&quot;helper &quot; &amp;lt;spamless@nospam.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g1gr2f$s6j$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm not sure I follow exactly, but maybe the ASSIGNIN and &lt;br&gt;
&amp;gt; EVALIN functions would help you?&lt;br&gt;
&lt;br&gt;
I know these functions. But I need variables from a running&lt;br&gt;
model (Simulink) in the workspace although the model is&lt;br&gt;
still running... So I think the 'assignin' and 'evalin'&lt;br&gt;
functions don't help me unless I use s-functions to transfer&lt;br&gt;
the data to workspace...</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 12:20:04 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434235</link>
      <author>Omur Bas</author>
      <description>&quot;Hans Gohle&quot; &amp;lt;ghostryder@gmx.de&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g1gsbm$868$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;helper &quot; &amp;lt;spamless@nospam.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;g1gr2f$s6j$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I'm not sure I follow exactly, but maybe the ASSIGNIN and &lt;br&gt;
&amp;gt; &amp;gt; EVALIN functions would help you?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I know these functions. But I need variables from a running&lt;br&gt;
&amp;gt; model (Simulink) in the workspace although the model is&lt;br&gt;
&amp;gt; still running... So I think the 'assignin' and 'evalin'&lt;br&gt;
&amp;gt; functions don't help me unless I use s-functions to transfer&lt;br&gt;
&amp;gt; the data to workspace...&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
You must issue a WriteLogs command from a function or the&lt;br&gt;
command line to get the data logged up until that point&lt;br&gt;
while the simulation is running.&lt;br&gt;
&lt;br&gt;
set_param(modelname,'SimulationCommand','WriteDataLogs')&lt;br&gt;
&lt;br&gt;
I hope this answers your question.&lt;br&gt;
&lt;br&gt;
Omur Bas&lt;br&gt;
www.promodsoftware.com.tr</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 12:24:02 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434236</link>
      <author>Hans Gohle</author>
      <description>&quot;helper &quot; &amp;lt;spamless@nospam.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g1gr2f$s6j$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm not sure I follow exactly, but maybe the ASSIGNIN and &lt;br&gt;
&amp;gt; EVALIN functions would help you?&lt;br&gt;
&lt;br&gt;
I know these functions. But I need variables from a running&lt;br&gt;
model (Simulink) in the workspace although the model is&lt;br&gt;
still running... So I think the 'assignin' and 'evalin'&lt;br&gt;
functions don't help me unless I use s-functions to transfer&lt;br&gt;
the data to workspace...</description>
    </item>
    <item>
      <pubDate>Tue, 27 May 2008 12:41:02 -0400</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#434244</link>
      <author>Hans Gohle</author>
      <description>&quot;Omur Bas&quot; &amp;lt;omur.bas@promodxxxxxx.com.tr&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g1gu9k$o6d$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Hans Gohle&quot; &amp;lt;ghostryder@gmx.de&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;g1gsbm$868$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;helper &quot; &amp;lt;spamless@nospam.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;g1gr2f$s6j$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I'm not sure I follow exactly, but maybe the ASSIGNIN and &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; EVALIN functions would help you?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I know these functions. But I need variables from a running&lt;br&gt;
&amp;gt; &amp;gt; model (Simulink) in the workspace although the model is&lt;br&gt;
&amp;gt; &amp;gt; still running... So I think the 'assignin' and 'evalin'&lt;br&gt;
&amp;gt; &amp;gt; functions don't help me unless I use s-functions to transfer&lt;br&gt;
&amp;gt; &amp;gt; the data to workspace...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You must issue a WriteLogs command from a function or the&lt;br&gt;
&amp;gt; command line to get the data logged up until that point&lt;br&gt;
&amp;gt; while the simulation is running.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set_param(modelname,'SimulationCommand','WriteDataLogs')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I hope this answers your question.&lt;br&gt;
&lt;br&gt;
Thanks a lot! That's EXACTLY what I was looking for!</description>
    </item>
    <item>
      <pubDate>Sat, 29 Nov 2008 23:40:17 -0500</pubDate>
      <title>Re: Scope of 'To Workspace' variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169881#613919</link>
      <author>Aditya K</author>
      <description>Hi,&lt;br&gt;
I am using Simulink v6.0 (R14) and &lt;br&gt;
set_param(modelname,'SimulationCommand','WriteDataLogs')&lt;br&gt;
fails with an error message that that 'WriteDataLogs' is an invalid setting. I suspect that my version does not support this value of SimulationCommand.&lt;br&gt;
&lt;br&gt;
I want to monitor active states of a Stateflow chart &quot;during&quot; the simulation. If I just log the signals (states) then the ModelDataLog object is available in the workspace only after the simulation is over. Can anyone suggest what to do?&lt;br&gt;
Thanks,&lt;br&gt;
Aditya.&lt;br&gt;
&lt;br&gt;
&quot;Omur Bas&quot; &amp;lt;omur.bas@promodxxxxxx.com.tr&amp;gt; wrote in message &amp;lt;g1gu9k$o6d$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; You must issue a WriteLogs command from a function or the&lt;br&gt;
&amp;gt; command line to get the data logged up until that point&lt;br&gt;
&amp;gt; while the simulation is running.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set_param(modelname,'SimulationCommand','WriteDataLogs')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I hope this answers your question.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Omur Bas&lt;br&gt;
&amp;gt; www.promodsoftware.com.tr&lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

