- Go to the MATLAB "Home" tab.
- In the Code section, click on Favorites > New Favorite.
- Enter a label for your Favorite command, such as "Run Main".
- In the code section, type "run('path_to_your_script/main.m')".
- Choose an appropriate icon for the favorite.
- Make sure to click "Add to quick access toolbar" and save.
launch .m from Quick Access Toolbar
15 次查看(过去 30 天)
显示 更早的评论
Hello,
I I am searching way to lauch quickly a m script while I am editing another m file.
The tpyical situation is when I am working on a subfunction sub_fct_1.m and I need to relaunch quickly the main.m script.
Is there a way to do that by adding an icon launching 'main.m' on the Quick Access Toolbar ?
or adding a button in a ribbon, to launch 'main.m' ?
or pressing a keyboard shorcut to lauch the main.m script ?
or having app that somehow do that ? (because I have seen that we can place app icon in the Quick Access Toolbar...)
or using an external program to catch a keyboard shorcut then launching via a command line the 'main.m' BUT without opening a new Matlab instance.
All ideas are welcome!
0 个评论
采纳的回答
Ramtej
2024-1-18
Hi Matthieu,
You can create a custom shortcut in MATLAB to run your "main.m" script as shown below
Now you can run the "main.m" file by clicking on your chosen icon in the quick access toolbar. This is one of the possible workaround.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!