How can I create shortcuts by commands?

조회 수: 17 (최근 30일)
Yao Li
Yao Li 2014년 2월 18일
댓글: Image Analyst 2014년 2월 18일
I'm wondering whether it is possible to create shortcuts on the toolbar by commands. I am going to release my GUI and I hope any user can install it by running a script (to add path and create a shortcut on the tool bar). Does Matlab have this kind of function/command? I just want to make the installation process simple so that even if the user is not familar with MATLAB can install the GUI by just a click. Any solution is welcome.

채택된 답변

Image Analyst
Image Analyst 2014년 2월 18일
The shortcuts are stored in an XML file:
C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2013b\shortcuts_2.xml
where username is whatever name the user logged in as. It's not easy, but you could have your installer add a shortcut to that file by writing the appropriate XML commands in there. Take a look in the file at some of your existing shortcuts to see what you'll need to do.
  댓글 수: 2
Yao Li
Yao Li 2014년 2월 18일
Thank-you. But will it result in problem in the previous Matlab release? I hope this method can be implemented at least in MATLAB 2008a.
Image Analyst
Image Analyst 2014년 2월 18일
They didn't use the _2 in earlier versions like that one. I think the solution offered by per looks like the easiest way for you.

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

추가 답변 (2개)

per isakson
per isakson 2014년 2월 18일
편집: per isakson 2014년 2월 18일
  • There is a file shortcuts_2.xml "in" prefdir, which "contains" the shortcuts. "First, make a backup ..."
  • See in FEX: Shortcut tools

Matt Tearle
Matt Tearle 2014년 2월 18일
If you're running 12b or later, why not just package and distribute your application as an app ? Then your users simply run the .mlappinstall file and your app is added to their toolstrip.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by