Set a workspace variable
cm_set_workspace_varSet a variable or field. The old value is logged and cm_revert_all restores it. Model-workspace changes live in memory until cm_model_save. Requires an idle simulation.
Instructions
Set a variable or field. The old value is logged and cm_revert_all restores it. Model-workspace changes live in memory until cm_model_save. Requires an idle simulation. overruled_by in the answer: the model has a variable of that name in its own workspace and uses that one, so set it there.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable or field, e.g. 'Kp_12' or 'Table.Value' | |
| scope | No | 'base' for the MATLAB base workspace, or the name of a loaded Simulink model for that model's workspace | base |
| value | Yes | Number, string, list or nested list (matrix) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||