File Exchange

image thumbnail

PI controller code in C and Python

version 1.0.0 (35.5 KB) by Bartlomiej Ufnalski
A brief demonstration of the capability of Simulink to execute C/C++ and Python code as a part of the numerical model.


Updated 29 Apr 2020

View License

You've come to the right place if you wonder how to append your Simulink model with C/C++ and/or Python code. Exactly such a capability is demonstrated here. A code for the PI controller with clamping is embedded into the Simulink model using four different approaches: S-Function written in m-code, MATLAB Function written in m-code, S-function written in C/C++ and MATLAB Function that invokes the external Python interpreter to run code written in Python. Enjoy!

Cite As

Bartlomiej Ufnalski (2020). PI controller code in C and Python (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux