Why did I receive these error messages? Unrecognized field name "angle1". angle1=180​-handles.a​ngle1; gui_mainfcn(gui_State, varargin{:}); feval(varargin{:});

22 ビュー (過去 30 日間)
N/A
N/A 2022 年 5 月 3 日
編集済み: N/A 2025 年 12 月 15 日 1:28
この 質問 は Walter Roberson さんによってフラグが設定されました
I have been coding a GUI

回答 (2 件)

Voss
Voss 2022 年 5 月 3 日
The code in pushbutton1_CreateFcn belongs in pushbutton1_CallbackFcn, most likely.
If you upload both the .m and the .fig file (using the paperclip icon), someone can run it and figure it out.

Walter Roberson
Walter Roberson 2022 年 5 月 3 日
What happens if edit3_Callback has not been executed yet, so you have not stored anything in handles.angle1 ?
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 5 月 3 日
The handles structure does not exist while CreateFcn are being run. The OpenFcn is responsible for creating the handles structure after the figure is loaded, but the CreateFcn are run while the figure is loading. So although you store text5 handle into the handles structure during a CreateFcn, that gets overwritten.
You can use the CreateFcn callbacks to change the properties of the object they are creating, such as changing size or colour or initial string, but you cannot affect what gets saved in the handles structure from there. Changes to the handles structure should go at the end of OpenFcn

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

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by