Calling external C codes in MATLAB Function block
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I am modeling an automotive system in Simulink. There are large amount of pre-written C codes which I have to call them in MATLAB Function blocks. As far as I know there are different methods to call an external function in MATLAB, like making MEX file or using Legacy Code Tool. Also I recently noticed that coder.ceval function is used in some similar cases. Since there several C code files and they have also dependencies, I am not sure which one is more efficient or possible in this case. Any idea would be greatly appreciated. Thanks.
0 Commenti
Risposte (1)
BhaTTa
il 17 Apr 2025
Modificato: BhaTTa
il 17 Apr 2025
Hey @Saeed Soltani, you can use below technology to model your system and call appropriate C functions:
C function block: https://www.mathworks.com/help/simulink/integrate-external-c-algorithms-using-c-function-block.html
System Objects: https://www.mathworks.com/help/matlab/system-objects.html
Below i have attached one such example of calling external C functions:
0 Commenti
Vedere anche
Categorie
Scopri di più su Write C Functions Callable from MATLAB (MEX Files) in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!