Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One possible method is to use the "get_param" function in Matlab to retrieve the "Minimum" and "Maximum" properties of the Simulink input block. Here is an example code snippet:

% Load the Simulink model into memory
model_name = 'my_model';
load_system(model_name);

% Get the handle to the Simulink input block
input_block_name = 'my_input';
input_block_handle = get_param([model_name '/' input_block_name], 'Handle');

% Get the minimum and maximum values of the Simulink input block
input_min = get_param(input_block_handle, 'Minimum');
input_max = get_param(input_block_handle, 'Maximum');

Note that the inputmin and inputmax variables will be strings, so you may need to convert them to numeric values using the "str2double" function. Also, make sure to replace "mymodel" and "myinput" with the actual names of your Simulink model and input block.