Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically set values for input ports in SIMULINK

I have simple system model in SIMULINK which I am trying to black-box test with minimum effort. I know that using MATLAB script, I can automate simulation and testing processes.

I have multiple In1 (SIMULINK block for top-level-input) ports and I want assign values to those input ports. I know that using Signal Builder block I can assign step/pulse/sine_wave/constant signals very easily, but that defeats the purpose of scripting and automating tests.

Does anyone know if it is possible to assign input values programmatically to the In1 ports in SIMULINK? If yes, how?

I will be trying to find the answer myself meanwhile. If I have any luck before, I will simply answer it! :)

like image 589
ha9u63ar Avatar asked Apr 29 '26 05:04

ha9u63ar


1 Answers

I would actually recommend importing data directly to the root-level ports of the models, rather than using the From Workspace block, that's precisely what they're designed for. See Import Data to Root-Level Input Ports in the documentation for more details.

like image 183
am304 Avatar answered May 01 '26 18:05

am304



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!