From: kaya aya on
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

"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