How to do a system call from simulink?

3 Ansichten (letzte 30 Tage)
Gunasheela Sadashivaiah
Gunasheela Sadashivaiah am 8 Nov. 2023
Kommentiert: Stefan Kerber am 16 Nov. 2023
I would like to embed a C executable in a Matlab Simulink block. The example C files are attached. This has a simple function that calculates sum of two numbers. Does the exe need special inputs/outputs to work with Simulink?, also how to use system call to execute the .exe file within simulink block.
  1 Kommentar
Stefan Kerber
Stefan Kerber am 16 Nov. 2023
Hello Gunasheela
It is not straight forward to do a system call from Simulink. However, since you have the C-code available I suggest to build a MEX Function from it. A starting point to learn how this works can be Create a Basic C MEX S-Function - MATLAB & Simulink (mathworks.com) or Build C MEX Function - MATLAB & Simulink (mathworks.com)
Good luck, best wishes
Stefan

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Simulink 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!

Translated by