Error displayed : Undefined function or variable 'Tg'

조회 수: 1 (최근 30일)
Kushal Badgujar
Kushal Badgujar 2012년 7월 15일
댓글: Cesar 2014년 11월 5일
Hello,I am familier with C++. I dont how to use Simulink. I have more than 10 variables which need to be declared only once before start of simulation. Simulation time is appro. 500 sec. I declared them in InitFcn in model explorer.
These variable are 3 dimensional and they are declared Globally in InitFcn and interesting thing is that these variable are shown in the workspace. But these variable are not available in 'Embedded Matlab Function' for futher processing.
Error displayed : Undefined function or variable 'Tg'(one of global variable name) Function 'Embedded MATLAB Function' (#18.38.40), line 3, column 14: "Tg"
Also for local variables of 'Embedded Matlab Function' similar error is displayed.

채택된 답변

C.J. Harris
C.J. Harris 2012년 7월 16일
Even if it is a global variable you still need to add it to your Embedded Function.
Open your Embedded Function, then click Tools -> Edit Data/Ports. From here you need to add your global variable 'Tg' as a parameter.
  댓글 수: 4
Kushal Badgujar
Kushal Badgujar 2012년 7월 23일
This is solved
Cesar
Cesar 2014년 11월 5일
How do you solved it?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by