I want to use a .mlapp to input user variables into my .m code
24 ビュー (過去 30 日間)
古いコメントを表示
:noob, take it easy on me.
I wrote a script to control a set of RF test instruments (spectrum analyzer, Signal Generator...)
Mostly just SCPI commands. the script works well.
I want to give this to other stakeholders, but it may be difficult for them to find and enter the user variables (TCIP address, intrument settings...) whithin the script.
The app designer looks like a great way to implement a GUI for this script.
I need help understanding how to merge the script (.m) and the app (.mlapp).
I converted the .mlapp to a .m by "save/Export to .m file"
where do I insert my script?
is that even the right (best) way to get what I want?
how do I get the GUI portion to run (get created), then wait for the user to enter the variables before continuing?
I can imagine an "execute" button on the GUI that would run the script, and the script would grab the variables from the GUI.
change the variables and "execute" again with the new variables.
any help would be greatly appreciated. If I can make this happen, there will be happiness spread across the land.
3 件のコメント
Rik
2022 年 1 月 28 日
Your script should be a function, then you can easily call it (either from inside the mlapp, or the m file).
回答 (1 件)
Reshma Nerella
2022 年 2 月 3 日
Hi,
To take input from your app created using app deisgner, you can use uicomponents like edit fields(text or numeric), drop down etc.You can add a button in your app, that user can click once all the inputs are filled. Add a button clicked function(callback for the button). When clicked, retrieve the input values required from the uicomponents. To call your script, you can
- Save the uicomponents values in base workspace and then call your.m script.
- Convert the script to a function and pass them as input arguments to your function.
Here are the few links for your reference:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!