Effacer les filtres
Effacer les filtres

Undefined function or variable 'getCurrentTime'.

2 vues (au cours des 30 derniers jours)
Edwin Joy
Edwin Joy le 3 Jan 2021
Modifié(e) : Edwin Joy le 6 Jan 2021
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 commentaire
Edwin Joy
Edwin Joy le 3 Jan 2021
Is getCurrentTime a global function? Or does it belong to a class? If, so which one?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Create System Objects dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by