How do I initialize and control a Simulink.Signal from an m-file or the command line.
For example, I can do this through the Model Workspace:
1) Add Simulink.Signal: ENABLE
2) Set the various attributes (Data type, Complexity, Dimensions, Sample mode)
3) Access it with an EMB block with this line in the embedded code: 'global ENABLE'
But, I load my model and initialize all the workspace parameters with m-files. How do I define this signal and set it's attributes from an m-file?
|
|
0
|
|
|
|
Reply
|
Debby
|
5/14/2010 3:00:25 PM |
|
"Debby " <debby.rice@takata.com> wrote in message <hsjoi8$3fn$1@fred.mathworks.com>...
> How do I initialize and control a Simulink.Signal from an m-file or the command line.
> For example, I can do this through the Model Workspace:
> 1) Add Simulink.Signal: ENABLE
> 2) Set the various attributes (Data type, Complexity, Dimensions, Sample mode)
> 3) Access it with an EMB block with this line in the embedded code: 'global ENABLE'
>
> But, I load my model and initialize all the workspace parameters with m-files. How do I define this signal and set it's attributes from an m-file?
temp = Simulink.Signal;
temp.DataType = 'double';
% etc for other Properties
modelWorkspace = get_param(modelName, 'ModelWorkspace');
modelWorkspace.assignin('ENABLE', temp);
Hope this helps,
Donn
|
|
0
|
|
|
|
Reply
|
Donn
|
5/14/2010 6:00:25 PM
|
|