필터 지우기
필터 지우기

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 CenterFile Exchange에서 Develop 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