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 CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by