Multiples instances of a C-Mex function and shared memory

4 views (last 30 days)
Hi,
I have an C-Mex S-function that implements a Tutsin - Eulor PECE algorithm.
The function is worky perfectly fine, if only one block is present in the model. If I put several instances of the block, to filter several signals, then the outputs starts to be null.
I think that the difference instances of the function share the same memory, and this mess with my states vectors. I am not using the discrete state functions provided by MatLab, instead I use my own declared arrays of doubles (real_T ) which are not extern.
Any lead about this would be appreciated.
The code can be found here:
https://www.dropbox.com/s/d5nfdnio6qqrizq/te_pece.c?dl=0

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!