O'Reilly logo

Getting Started with Simulink by Luca Zamboni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Going further – C MEX S-functions

Now we'll learn how to develop a custom S-function block using the C language. A basic knowledge of the C syntax is required.

The C language offers some advantages over MATLAB's scripting language:

  • It is the most-used language to develop (hard) real-time systems
  • It is one of the most popular languages, if not the most popular
  • C executables offer unparalleled performance with respect to MATLAB scripts
  • C S-functions can be developed without having MATLAB installed (but you'd still need the external headers and libraries)
  • Legacy C code can be easily ported to S-function blocks and used in Simulink
  • C++ compilers can be used, giving access to some powerful C++ frameworks like Qt

C MEX S-functions are programmed in C/C++ and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required