App Designer: How to refresh Text or Num field after assigned new value

1 回表示 (過去 30 日間)
vincent Dumoulin
vincent Dumoulin 2021 年 10 月 6 日
回答済み: vincent Dumoulin 2021 年 10 月 6 日
When I launch my App.mlapp I would like to insert in a numeric field the last value displayed before I close my App. But the field does not refresh and the new value does not appear. How can I do ?
function Test_App_Startup_CallBack(app)
clearvars –global;
load('C:\PQATestBenchNavigation\50 - Steering Wheel TestBench\defaultparameters.mat','testparameters');
global testparameters;
testparameters = importdata('defaultparameters.mat');
app.Fw_VersionEditField.Value = testparameters.fwVersion;

回答 (2 件)

Chetan Bhavsar
Chetan Bhavsar 2021 年 10 月 6 日
編集済み: Chetan Bhavsar 2021 年 10 月 6 日
Issue can be in 2 things
1)App edit field not refreshing
I dont think this is the case
2) testparameters not getting updated?
can you try adding one line to get to know if testparameters has right value?
msgbox(testparameters.fwVersion)
If testparameters.fwVersion is not str
msgbox(num2str(testparameters.fwVersion))
Please check and let me know output of msgbox then we can debug further
  2 件のコメント
vincent Dumoulin
vincent Dumoulin 2021 年 10 月 6 日
Hi Chetan,
msgbox(testparameters.fwVersion) display the expected value.
Chetan Bhavsar
Chetan Bhavsar 2021 年 10 月 6 日
function Test_App_Startup_CallBack(app)
this is start up fucntion?
can your share mat file if possible?

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


vincent Dumoulin
vincent Dumoulin 2021 年 10 月 6 日
Find the code in attachement

カテゴリ

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