Passing edit field numeric values to base workspace

2 ビュー (過去 30 日間)
Vangala
Vangala 2023 年 12 月 11 日
コメント済み: Vangala 2024 年 11 月 4 日
I'm using app designer to link it with one simulink model of mine. I had used editfield (numeric) in app such that inputs to simulink model can be given through this app. The variables declared in app code will be used in simulink model. But when I give numeric inputs to app and run, the variables in simulink are showing it as 0 in the base workspace too.
Syntax used for assigning a variable to editfield is:
assignin("base", "variablename", app.EditFieldName.Value);
Please give me the solution to this.

採用された回答

Cris LaPierre
Cris LaPierre 2023 年 12 月 11 日
An example app I created works as expected.
% Value changed function: EditField
function EditFieldValueChanged(app, event)
assignin("base","TestVar",app.EditField.Value)
end
  1 件のコメント
Vangala
Vangala 2024 年 11 月 4 日
Yes, it worked. Thank you.

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

その他の回答 (0 件)

カテゴリ

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