フィルターのクリア

Unable to update app GUI fields after load

1 回表示 (過去 30 日間)
Justin Morse
Justin Morse 2020 年 4 月 3 日
編集済み: Urmila Rajpurohith 2020 年 4 月 6 日
I am currently trying to create save/load functionality to an app.
I am confident that my load function is working because I have successfully output loaded variables from save file in a message box after a clear command.
My issue is after the load, I am trying to update all EditFields on my GUI with the loaded variables. However, it appears after the load function, I lose all ability to update EditField.Value on my GUI. I have tried using numbers for EditFields.Value instead of variables to remove any variable issues. This shows the issue is not tied to variable loading issues. I have also commented out the load line entirely and it works perfectly. See pics below of load vs. commented out load lines.
I inserted the figure(app.UIFigure) based on issue other were seeing where the GUI window doesn't appear to be selected and on top of all other windows. This has not helped either. Link: https://www.mathworks.com/matlabcentral/answers/296305-appdesigner-window-ends-up-in-background-after-uigetfile
Any help is greatly appeciated!!!
EditField.Value (lines 1104 & 1105) do not work.
EditField.Value (line 1104 & 1105) work after commenting out load line. I also had to comment out the clear command to prevent an error.
  1 件のコメント
Justin Morse
Justin Morse 2020 年 4 月 3 日
I found a work-around or fix(???) although I still don't understand why it is needed.
when I assign the load to a variable as below, the issue goes away.
var=load(fullfile(pathname,filename));
I am still curious why the original load line does not work properly.

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

採用された回答

Urmila Rajpurohith
Urmila Rajpurohith 2020 年 4 月 6 日
編集済み: Urmila Rajpurohith 2020 年 4 月 6 日
you can refer to the below documentation on "Unexpected Results when loading variables within a funcion" to understand working of "load" function

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by