How to turn existing code into app and which components to use?

조회 수: 13 (최근 30일)
Julia Williams
Julia Williams 2019년 12월 3일
댓글: Walter Roberson 2019년 12월 4일
Hello! I would like to create an app that would promt a user to select a file from thier computer and then run code that I have already created. I know I need to use app designer but I do not understand which component to select to prompt the user to select and file and then on the back end how to apply my function. Any help is appreciated!
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 12월 3일
uigetfile() can be used in App Designer.
Julia Williams
Julia Williams 2019년 12월 4일
Hi Walter! Thank you for your help!

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

채택된 답변

Bhaskar R
Bhaskar R 2019년 12월 3일
You can use any action UI control button in app designer, suppose mostly used one is push button. In the respective UI control call back write your code as
[flname, pt] = uigetfile('*.m', 'Select the m file');
run([pt, flname])
For more info/ help on MATLAB app designer read
  댓글 수: 2
Julia Williams
Julia Williams 2019년 12월 4일
Hi Bhaskar! I ended up using this! Thank you so much!
Walter Roberson
Walter Roberson 2019년 12월 4일
Note: it would be better to use
run(fullfile(pt, flname))
uigetfile does not promise that the path will end in a directory separator.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by