launch .m from Quick Access Toolbar

조회 수: 10 (최근 30일)
Matthieu
Matthieu 2024년 1월 18일
댓글: Matthieu 2024년 1월 18일
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!

채택된 답변

Ramtej
Ramtej 2024년 1월 18일
Hi Matthieu,
You can create a custom shortcut in MATLAB to run your "main.m" script as shown below
  1. Go to the MATLAB "Home" tab.
  2. In the Code section, click on Favorites > New Favorite.
  3. Enter a label for your Favorite command, such as "Run Main".
  4. In the code section, type "run('path_to_your_script/main.m')".
  5. Choose an appropriate icon for the favorite.
  6. Make sure to click "Add to quick access toolbar" and save.
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.
  댓글 수: 1
Matthieu
Matthieu 2024년 1월 18일
Excellent !! Exactly what was needed !!
Thanks a lot !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by