Matlab not recognizing edits to custom function

9 visualizzazioni (ultimi 30 giorni)
T-800
T-800 il 14 Dic 2022
Commentato: T-800 il 14 Dic 2022
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.

Risposte (1)

Jan
Jan il 14 Dic 2022
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 Commento
T-800
T-800 il 14 Dic 2022
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.

Accedi per commentare.

Categorie

Scopri di più su Software Development Tools in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by