Ralff
Ralff

Reputation: 491

How do I define variables in simulink model (instead of in workspace)?

I want to define a few variables in a simulink model. The matlab function block doesn't work because the variables are local. The variables are not input to other blocks, but instead, the variables are parameters to other blocks.

Basically, I want to have a block where I can define a bunch of variables that set the parameters for other blocks. I did this once in the past more than a few years ago now, but I can't find or remember how to do it.

I thought I used a block, but potentially, I set the variables somewhere in model settings or something. I can't remember, and I am not having luck finding it. Any help is much appreciated! I feel this is simple, but I just can't find the solution.

Upvotes: 1

Views: 17362

Answers (2)

Dorababu
Dorababu

Reputation: 21

You can use Simulink data dictionary or model workspace to store the variables/Parameters. go through this link to get more info Usage of the variables/Parameters/Signals for simulink models

Upvotes: 1

Edric
Edric

Reputation: 25140

You can do this by defining your data in the model's "Model Workspace", like this: screenshot of model workspace. There's more about the Model Workspace in the doc. There are various options as to where you can store the parameters.

Upvotes: 1

Related Questions