Is it possible to change the value of a global variable in app designer?

Hello,
I initialized a matrix as a global variable (in the properties of the app) and I am now trying to fill it thanks to function called in differents callbacks. Is it possible to keep in memory the matrix filled with a previous callback and use it later with another callback.
I don't know if it is possible to create a variable in the properties that keep in memory the matrix filled, and then call it in another part of my code?
Thank you

 採用された回答

Dennis
Dennis 2021 年 3 月 15 日
Yes, you can use one matrix for several callbacks and it will keep its values. It will be stored as app property, so you need to use app. .
%in the property section:
mymatrix
%in your callback
app.mymatrix

3 件のコメント

Aurélie B
Aurélie B 2021 年 3 月 18 日
Ok, thank you very much. Does it matters if the property is private or public in this case?
Dennis
Dennis 2021 年 3 月 18 日
If the property is private you can only use the matrix in callbacks of appdesigner.
If it is public you can also pass it to functions outside of appdesigner.
Aurélie B
Aurélie B 2021 年 3 月 18 日
ok perfect, thank you

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

質問済み:

2021 年 3 月 15 日

コメント済み:

2021 年 3 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by