Undefined function or variable 'getCurrentTime'.

I get an error: "Undefined function or variable 'getCurrentTime'." while using getCurrentTime function in the MATLAB System Block in Simulink. I tried to invoke the function in the command window. It throws the same error
The code is embedded below:
function y = stepImpl(obj, in)
v = interp1(obj.clk, obj.usage, getCurrentTime(obj));
obj.vol = obj.vol + in - v;
y = obj.vol/(pi * obj.r^2);
end
getCurrentTime is a function that should return the current simulation time in MATLAB System Block
The error I get is the following

댓글 수: 1

Is getCurrentTime a global function? Or does it belong to a class? If, so which one?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Create System Objects에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2021년 1월 3일

편집:

2021년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by