开发者

How do I display a file or directory browser dialog using MATLAB

开发者 https://www.devze.com 2023-01-01 21:14 出处:网络
I have created a blank GUI and now I wan开发者_开发知识库t to program a push button to display a file or directory browser dialog.Your question could use a little more detail, but here\'s a general su

I have created a blank GUI and now I wan开发者_开发知识库t to program a push button to display a file or directory browser dialog.


Your question could use a little more detail, but here's a general suggestion to get you started...

You could set the callback for your push button so that it invokes one of the built-in dialog boxes available in MATLAB. You may be most interested in UIGETDIR or UIGETFILE to browse for and select a directory or file, respectively.


In addition to gnovice's advice, if you want your directory browser to be embedded within your GUI (as opposed to opening in a separate dialog window), you can use Java component. Take a look at my UICOMPONENT utility on the File Exchange for a working example.

Alternately, you can design your own tree-view of folder contents within a matlab panel, using the documented yet unsupported UITREE function or a Java JTree component (take a look at my UIINSPECT or FINDJOBJ utilities for working examples).

0

精彩评论

暂无评论...
验证码 换一张
取 消