Modifying input arguments in the MatLab 2017 App designer

2 ビュー (過去 30 日間)
Richard DeMark
Richard DeMark 2017 年 12 月 20 日
コメント済み: Basem Nabil 2019 年 5 月 9 日
Using MatLab 2017 App Designer, I am trying to pass arguments from one app to another app. For example, when user data is entered from one app, I wish to close the first app and pass the data in the form of input arguments upon immediately opening the second app from the first app. I have not found a way to modify the input arguments of an app even though I am repeatedly seeing that it is possible using https://www.mathworks.com/help/matlab/creating_guis/app-designer-startup-function.html as a reference. However, I am not seeing the "app input arguments" in the editor tab in my version.
Any advice on how to overcome this issue? Thank you in advance for your assistance!

回答 (1 件)

Melissa Williams
Melissa Williams 2018 年 1 月 24 日
Hi Richard,
This feature was introduced in MATLAB R2017b. The documentation always refers to the most current version of MATLAB. If possible, your best bet is to upgrade to R2017b.
If upgrading is not an option, you can achieve what you are trying to do by adding a public property on your second app.
Instead of passing in the value when you launch the app,
  1. launch the second app and hold a reference to it, such as mySecondApp = app2.
  2. set the value you want to pass to the public property, mySecondApp.foo = someValue.
  3. Close the first app
Hope this helps, let me know if any steps need additional clarification
-Melissa
  1 件のコメント
Basem Nabil
Basem Nabil 2019 年 5 月 9 日
Hello,
I have the same issue and I followed your steps but I keep getting an error. That's my code.
services in the 2nd app.
ID & Name are 2 public properties in the 2nd app.Annotation 2019-05-09 235522.png
services();
ser = services;
ser.ID = record.ID;
ser.Name= Name;
closereq;

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

カテゴリ

Help Center および File ExchangeDevelop 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