How do I pass struct between functions in app designer

3 Ansichten (letzte 30 Tage)
William Pang
William Pang am 16 Nov. 2020
Beantwortet: Mario Malic am 16 Nov. 2020
I'm trying to pass a structure from one function to another in app designer and I'm not sure what to do.
I tried app.(Variablename) = variable (where the variable is a 1x1 struct) but it pops up an error message saying unrecognized property for class 'orientation'
Thanks!

Akzeptierte Antwort

Mario Malic
Mario Malic am 16 Nov. 2020
Hello,
in the properties block, initialise your variable as struct
example = struct();
and refer to it within other functions as
app.example.field1 = 1;

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by