フィルターのクリア

How can I organize app class properties like structs?

3 ビュー (過去 30 日間)
Radu Andrei Matei
Radu Andrei Matei 2022 年 5 月 3 日
編集済み: Matt J 2022 年 5 月 3 日
Hi, I'm creating an app based on functions that I programmed outside of app designer. These functions organize all the variables into structs. I make the app ask for the values of some of these variables as input data which I then want the app to transfer to my external functions to make calculations. The problem is that I have hundreds of variables. Naive me wanted to create properties with similar names to the structs from my functions and then just call the external functions, compute the results, save them in structs and say that app.Struct = struct for each struct, but of course that didn't work. Is there a way for me to group variables into something similar as structs so that I don't have to create hundreds of properties, one for each variable?
And if this question doesn't make much sense, my broader problem is how to use external functions in the app designer code. I just want my app to ask for values and input those into my external functions to obtain results so that I can display those results in the app again but those data transfer processes, from app to functions and back, yeah, I don't understand how to manage them so if someone can forward me to documentation or useful info it'd be greatly appreciated.
  1 件のコメント
Stephen23
Stephen23 2022 年 5 月 3 日
How about nesting those structures into one structure?

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

回答 (1 件)

Matt J
Matt J 2022 年 5 月 3 日
編集済み: Matt J 2022 年 5 月 3 日
The problem is that I have hundreds of variables.
Assuming they are scalar, they should be bundled together in a vector, not a struct. That's what vectors are for.
my broader problem is how to use external functions in the app designer code
Not sure what "external" means here. Any function you can call from the command line, or from within a Matlab script or function, can be called from within an app callback function in precisely the same way.

カテゴリ

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