Block Properties in Simulink
What Are Block Properties?
In Simulink, every block has properties that control how it works in the model. You can change these properties using MATLAB scripts, which helps in automation, tuning and model setup.
Examples of block properties:
- Parameter values like Gain = 5
- Data type and signal size
- Sample time or how often it runs
- Execution order or priority
- Notes or documentation
- Block name, type, position, and direction
- Commented status, whether the block is active or disabled
Accessing Block Properties via Scripting
We use get_param() and set_param() functions.
% Get a parameterval = get_param('model/Gain', 'Gain');% Set a parameterset_param('model/Gain', 'Gain', '10');
Common Block Properties

Example โ Automating Model Parameter Updates
model = 'engine_model';load_system(model);set_param([model '/Throttle'], 'Gain', '2.5');save_system(model);
Workspaces in MATLAB
What Is a Workspace?
A workspace is a memory space where MATLAB keeps variables. Simulink can use different workspaces, such as for models, masked subsystems, and the base MATLAB workspace.

Types of Workspaces

Using Workspaces in Practice
Assigning Variables to Base Workspace
assignin('base', 'speed_limit', 100);
Evaluating Expression in Another Workspace
val = evalin('base', 'speed_limit + 20');
Accessing Model Workspace
ws = get_param('my_model', 'ModelWorkspace');ws.assignin('gain_factor', 5.5);
Automotive Use Cases
