Prev: Database toolbox update function
Next: contour area
From: kaya aya on 1 Nov 2009 02:04 hello all, I am trying to read a workspace variable into a simulink model in real-time. 1. created the variable "cstat" in the workspace. 2. built and ran a simple simulink model in real-time (external mode): "from workspace block" specifying cstat------> "scope" 3. scope displays the correct value of cstat 4. when i try to have cstat changed through command prompt: workspace value changes but scope keeps displaying the old value.. .... am i missing something? please let me know :)
From: Arnaud Miege on 2 Nov 2009 04:31 "kaya aya" <engr.khalid.alawadi(a)gmail.com> wrote in message news:hcjbt1$eh4$1(a)fred.mathworks.com... > hello all, > > I am trying to read a workspace variable into a simulink model in > real-time. > > 1. created the variable "cstat" in the workspace. > 2. built and ran a simple simulink model in real-time (external mode): > "from workspace block" specifying cstat------> "scope" > 3. scope displays the correct value of cstat > 4. when i try to have cstat changed through command prompt: > workspace value changes but scope keeps displaying the old > value.. > > ... am i missing something? > > please let me know :) > You can't. A parameter in the MATLAB workspace is read at the beginning of a simulation and remains at that value for the duration of the simulation. What you have is a signal, not a parameter. Represent it using a signal. Alternatively, use the set_param command to change the block parameter directly while the simulation is running. HTH, Arnaud
|
Pages: 1 Prev: Database toolbox update function Next: contour area |