Matlab not recognizing edits to custom function

9 ビュー (過去 30 日間)
T-800
T-800 2022 年 12 月 14 日
コメント済み: T-800 2022 年 12 月 14 日
I have a custom function that I have made some edits to. When I run the function as a regular script it performs as expected. However, once I add these changes to my pre existing function and try to run it it behaves as if my changes haven't been made and produces the output that the previous version would. It does this even if the function has been deleted from matlab entirely which is really odd to me. I've tried clearing, restarting, deleting the function entirely, rehashing but nothing as seemed to work. Any ideas would be appreciated.

回答 (1 件)

Jan
Jan 2022 年 12 月 14 日
Is the a P-coded version of the function?
What does which(funcname, -all) show? Maybe there is another version of the function with the same name?
Do you store the function in a folder inside Matlab's installation folder? This would be a bad idea. Then rehashing is the workaround, but use the most powerful argument:
rehash TOOLBOXCACHE
Does the function contain an mlock command? If so, and there is no mechanism to unlock it, restart Matlab and implement an unlocking before the function is called.
  1 件のコメント
T-800
T-800 2022 年 12 月 14 日
Hi Jan,
No there is only the .m file. Then which(funcname, -all) returns function not found. I'm using matlab online and when the function isn't deleted it is stored in the overall current folder (matlab drive). There is no mlock command. Additionally if I just put the script in a new function.m file with the same name but with some number added to the end i.e. function --> function2 then it works as expected.

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

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by