フィルターのクリア

How to remove one of the favorite command programmatically in MATLAB 2022b

3 ビュー (過去 30 日間)
Tejashree Saraf
Tejashree Saraf 2023 年 6 月 23 日
コメント済み: Julian Hapke 2024 年 3 月 27 日
Hello,
I am trying to add & remove in favorite commands in MATLAB 2022b.
In 2017b, below code used to work:
scUtils = com.mathworks.mlwidgets.shortcuts.ShortcutUtils;
scUtils.removeShortcut(RemovegroupOfShortCut, label); % remove short-cut
But its not working in matlab 2022b.
  1 件のコメント
Ashutosh
Ashutosh 2023 年 6 月 24 日
Hi,
Are you not able to find this drop down menu under Favorites in the 'Home' tab of the upper Toolstrip? I believe this is what you are looking for

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

回答 (1 件)

Ram Sreekar
Ram Sreekar 2023 年 6 月 28 日
編集済み: Ram Sreekar 2023 年 6 月 28 日
Hi Tejashree Saraf,
As per my understanding you would like to remove one of your favourite commands programmatically.
You can refer to the example code given below.
favCmds = com.mathworks.mlwidgets.favoritecommands.FavoriteCommands.getInstance()
favCmds.removeCommand(command_name, category_name)
% removeCommand() removes the specified command from the specified category
Replace 'command_name' with the name of the command you want to remove and the 'category_name' with the category in which the command is present. Both 'command_name' and 'category_name' should be strings.
If you have not created any category and the command exists inside ‘FAVORITE COMMANDS’ then replace 'category_name' with the string "Favorite Commands".
Hope this helps you resolve your query.
  2 件のコメント
Tejashree Saraf
Tejashree Saraf 2023 年 7 月 3 日
Thanks a lot its helpful
Julian Hapke
Julian Hapke 2024 年 3 月 27 日
Do you happen to know how I can delete all favorite commands programmatically without knowing any of their names?

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by