S-Function - how do I start with external C/C++ files?

1 view (last 30 days)
Hello! I have a class written in C++ and I need to use an object of that class in S-Function. For convenience lets say the class is called MyClass and it has a method int add(int in).
What I need to do is take an input from a simulink block, then inside s-function I want to call: sfunc_output = MyClassObject.add(sfunc_input), and next pass this caluclated value to s-function output.
So... Is something like that possible? I'm completely new in Simulink and it's only one-time assignment. I need a example which does something similar to my problem. Can you point me in a right direction?

Answers (0)

Community Treasure Hunt

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

Start Hunting!