my scripts won't update.

28 ビュー (過去 30 日間)
Netanel Freinkel
Netanel Freinkel 2019 年 6 月 5 日
コメント済み: John D'Errico 2019 年 6 月 6 日
Hi!
For some reason, my scripts get "stuck" and ignore changes. I can even see in the workspace that values won't change. For example, a graph that won't change even after changing some of the values (sometimes it will give me a few rounds and the stop, sometimes not even that).
Same goes with functions- I'll change the function, but when I'll use the new version I'll get the same result again, even when trying to apply it on another variable, and even after changing, saving, and restarting matlab- as if matlab will always relate only to the first version of the script (even though I have saved a different one) and I have only one chance to write the script correctly.
Thank you very much!
  2 件のコメント
darova
darova 2019 年 6 月 5 日
Is there any change you can show your script?
Netanel Freinkel
Netanel Freinkel 2019 年 6 月 6 日
Hi, I'm not sure I understood your question :/

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

採用された回答

Jan
Jan 2019 年 6 月 5 日
編集済み: Jan 2019 年 6 月 5 日
Are you sure that you edit the function which you run? Or do you have different versions of the function in different folders, and while you edit C:\YourData\theFile.m you run C:\Temp\yourFcn.m?
Check this by
which yourFcn -all
Maybe you use a folder inside the Matlab installation folder for working? This would be a bad idea, but at least the updates should be accepted after:
rehash toolbox
  2 件のコメント
Netanel Freinkel
Netanel Freinkel 2019 年 6 月 6 日
Hi!
First of all, thank you very much for the quick response.
So I did the check, and indeed, it gave me two results- one of the folder I'm working in, and one from the toolbox. seems like I've been using a function name already used by matlab ("Jacobian" :/ could have been smarter).
So as for now it works and changes are accepted. Hope that was the only case, cause it already happened to me, but I can't remember what was the function name the other time.
Thank you very much again!
John D'Errico
John D'Errico 2019 年 6 月 6 日
Never name your functions with the same name as existing tools in MATLAB. Bad idea to do that. :)
As well, never put your functions in the MATLAB provided directories. They won't reflect any changes, becaue those directories are cached when MATLAB starts up. Us your own directory for your code, then added to the MATLAB search path.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by