UndefinedFunction error for a known script

7 ビュー (過去 30 日間)
fani
fani 2023 年 11 月 24 日
回答済み: Shivam Lahoti 2025 年 3 月 5 日
I'm running a lab exercise on topic real-time calculation, which runs a simple pump, from my laptop. It runs ok for an hour and then all of a sudden I get the following error:
The 'real_time' function/script is known. It's basically a script triggered by timer that calculates heat and mass balance only, no external functions used. The error is pointing to:
I asked the teacher assistant and he found it strange, basically did not know the answer. Any idea what could be the problem and how to fix it? Thank you!
  3 件のコメント
Walter Roberson
Walter Roberson 2023 年 11 月 24 日
Does your code contain any cd() calls?
fani
fani 2023 年 11 月 24 日
Thank you for asking. I have checked it and it does not contain any cd() or 'change directory' function call.

サインインしてコメントする。

回答 (1 件)

Shivam Lahoti
Shivam Lahoti 2025 年 3 月 5 日
Hi Fani,
I understand you are receiving a 'MATLAB:UndefinedFunction' exception. The error states 'undefined function or variable 'real_time''.
This can stem from multiple reasons, and one of them could be missing dependencies. Your MATLAB setup might be missing a toolbox add-on, or 'real_time' might be a function from some File Exchange submission that was not properly downloaded to your system.
To verify if the 'real_time' function is a MATLAB built-in function and if you are missing the toolbox that contains the function, run the following in the MATLAB CLI:
help real_time
If the above command shows that this is not a MATLAB built-in function, it might be the reason you are receiving this exception. Kindly check that the function file is present and is in the MATLAB path.
I hope this helps.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by