フィルターのクリア

How do I create an App Designer App that lists the contents of a user-chosen directory?

22 ビュー (過去 30 日間)
I would like to design an app that allows the user to browse for a folder, that displays the folder location, and that displays the folder contents to the app.  I would like to use App Designer to make the app.  How can I do this in App Designer?

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 9 月 13 日 0:00
編集済み: MathWorks Support Team 2024 年 9 月 13 日 17:54
Refer to the attached example App Designer file named 'ExampleDirectoryApp.mlapp'.  In the attached example App, there is a 'browse' button, a label to display the selected folder location, and a uitable to display the contents of the selected folder location.  When the app is run, the user clicks on the 'browse' button to trigger a callback.  The callback executes the 'uigetdir' command to get the directory and then displays the directory to the label.  Finally, the callback obtains the directory contents using the 'dir' command and displays the contents in the uitable.
 
For more information and details about the implementation, refer to the attached file and the comments in the file.  Please note that, because the contents of the directory are displayed in a uitable, the contents are selectable.  That is, if desired, the 'CellSelectionCallback' can be created on the uitable to execute code based on the user's selection of the folder's contents.  Please also note that the app was designed to be run in MATLAB R2018a.
 
For more information about the relevant functions and callbacks in this example app, please refer to the following links:
 
NB
: If you are having trouble downloading the attachment, please right-click on the file and select 'Save link as...'.
  3 件のコメント
Jesus Sanchez
Jesus Sanchez 2019 年 7 月 12 日
Nevermind, using uigetdir it is easy enough to not need further guidance.
Thanks for your time
farzad
farzad 2020 年 3 月 18 日
Dear Jesus, shall you please put the code text ? to be usable for older versions ?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by