Returning output signals from a Simulink block to Matlab
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Luke Chapman
am 2 Mär. 2023
Kommentiert: Fangjun Jiang
am 10 Mär. 2023
I have a Simulink Block with 9 output signals which can either be 0 or 1 (true or false). Each output signal is connected to an OutBus. I want to be able to get the values for each of the signals in Matlab so I can assign them to variables and use them elsewhere. I need to be able to do this while the simulation is running, which is where I am having trouble. Any help would be appreciated.
3 Kommentare
Fangjun Jiang
am 6 Mär. 2023
Usually, it is difficult to access Simulink signals when the simulation is running. That is why @Paul asks for further clarification. You could do that processing using a MATLAB Function block and add it to the Simulink model.
Akzeptierte Antwort
Fangjun Jiang
am 6 Mär. 2023
5 Kommentare
Fangjun Jiang
am 10 Mär. 2023
The doc says "Your callback function can be specific to a single signal, or you can use the same callback to process and visualize multiple signals. The callback function only has access to data for a single signal at a time. "
Fangjun Jiang
am 10 Mär. 2023
Route those two signals together to make a nonvirtual bus. Make it nonvirtual or convert it to nonvirtual.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Sources finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!