Filter löschen
Filter löschen

Code reuse between several Embedded Matlab Function

1 Ansicht (letzte 30 Tage)
p fontaine
p fontaine am 7 Mai 2011
Is it possible to share code between several Embedded Matlab Function blocks rather than to duplicate it ? For instance, if I have 2 blocks B1 and B2 which need to use the same function y = f(x) embedded in each block, how to avoid a duplication of the code of the function f() in each block ?

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 9 Mai 2011
I think you just need to define the function with the %#eml (%#codegen starting in R2011a) directive, and place it somewhere on the MATLAB path. You can then call this function from multiple Embedded MATLAB Function blocks.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by