How to turn existing code into app and which components to use?
18 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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 个评论
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 Center 和 File 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!