How to do a system call from simulink?

3 views (last 30 days)
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 Comment
Stefan Kerber
Stefan Kerber on 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

Sign in to comment.

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!