필터 지우기
필터 지우기

Code reuse between several Embedded Matlab Function

조회 수: 1 (최근 30일)
p fontaine
p fontaine 2011년 5월 7일
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 ?

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 5월 9일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by