Undefined function or variable 'getCurrentTime'.
조회 수: 2 (최근 30일)
이전 댓글 표시
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/477188/image.png)
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!