- Create a new MATLAB script file.
- Create a new context menu object using the ‘uicontextmenu’ function.
- Add a menu item to the context menu object using the ‘uimenu’ function.
- Set the callback function for the menu item to the script that you want to run when the menu item is selected.
- Attach the context menu object to the current folder using the 'set' function.
Custom context menu in the current folder to open .mat file using a script
5 ビュー (過去 30 日間)
古いコメントを表示
I have a script throug which I open some .mat files.
I would like to create a custom context menu in the current folder so that I can select the .mat file, select the custom menu voice and have the file name and path passed to the script which will open the .mat doing some things before and after opening it.
Is it possible to do that? How?
Otherwise is it possible to create an app and drag and drop the mat file to the app icon which will then call the script?
0 件のコメント
回答 (1 件)
Vidip Jain
2023 年 10 月 5 日
I understand you want to create a custom context menu in the current folder such that you can select the .mat file and have the file name and path passed to the script which will open the .mat file.
To create a custom context menu in the current folder, you can use the ‘uicontextmenu’ function in MATLAB. The ‘uicontextmenu’ function creates a context menu that can be attached to any UI object, including figures and axes objects.
To create a custom context menu for the current folder, you can follow these steps:
For further information, refer to the documentation links below:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!