Modeling of a legacy code

조회 수: 3 (최근 30일)
byungkeuk cho
byungkeuk cho 2017년 5월 25일
댓글: Walter Roberson 2017년 5월 25일
Hello,
I have a question about simulink modeling of a legacy code.
Let's assume that i have a legacy code as below in one file.
[test.c]
static single a=0.;
static single b=0.;
void FcnA(single ain, single *aout)
{
a = ain;
*aout = a;
}
void FcnB(single bin, sinlge *bout)
{
b = a * bin;
*bout = b;
}
I would like to integrate the legacy code above in simulink without modifying the code.
I can use the legacy code tool to model the code but the problem is that FcnB does not use the variable 'a' as an input argument. So i cannot think of any way to integrate the code in simulink.
Is there a good way to do it?

답변 (1개)

Walter Roberson
Walter Roberson 2017년 5월 25일
coder.ceval(), possibly the second example if the code is already compiled into a single library.

카테고리

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

Community Treasure Hunt

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

Start Hunting!