how to share data betwen app designer and simulink?

3 Ansichten (letzte 30 Tage)
marwen mrabti
marwen mrabti am 7 Aug. 2018
Beantwortet: Akshat am 26 Nov. 2024 um 20:35
hello everyone, i am building an app that must send and recieve data from and to simulink.. could anyone,please,tell me how to do it. thank you.

Antworten (1)

Akshat
Akshat am 26 Nov. 2024 um 20:35
To enable communication between a MATLAB app and Simulink, you can use the MATLAB Function block in Simulink and MATLAB's "set_param" and "get_param" functions. Here's a basic approach:
MATLAB Function Block: Use this block in your Simulink model to run MATLAB code. You can define inputs and outputs to facilitate data exchange.
Simulink to MATLAB App:
  • Use Simulink's To Workspace block to send data from Simulink to the MATLAB workspace. This data can then be accessed by your MATLAB app.
  • Alternatively, use the sim command in MATLAB to run the Simulink model and retrieve outputs directly.
MATLAB App to Simulink:
  • Use set_param to modify parameters of the Simulink model from your MATLAB app.
  • To input data into Simulink, consider using From Workspace or Constant blocks, which can take data from the MATLAB workspace.
Hope this helps!

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by