Can I run 2 versions of a function in 2 different Matlab sessions?
3 ビュー (過去 30 日間)
古いコメントを表示
I am wondering if it is possible to run 2 versions of the same function in 2 different Matlab sessions.
- Let's say I have a function named myFunction.m, and I start a Matlab session ("Session 1") and run a script which calls myFunction many times over its 2-hour run time. Let's call this version of myFunction.m "Version 1".
- While session 1 is running the script, I edit myFunction (call this "Version 2"). I save myFunction with the original name and in the original location.
- I then open another Matlab session ("Session 2"), and run the script which calls myFunction many times.
I believe Session 1 will continue to run Version 1 of myFunction, while Session 2 will run Version 2 of myFunction. Is that correct?
2 件のコメント
Andreas Goser
2014 年 2 月 17 日
This is technically interesting and I also have a "believe", but I am hesitant to answer because I would not rely on this behaviour continues to be the same for the future. So if this is just curiosity - why don't you try? If it is for a serious application - I am sure there is a better way and wonder which problem you want to solve with this approach?
採用された回答
Iain
2014 年 2 月 17 日
You most certainly can run Version 1 of function "blah" in one instance of matlab, update blah to version 2, open up a second instance of matlab, and run the function.
Why wouldn't you just use a different function name for version 2 though? Its less prone to things going wrong.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!