Arrays on AppDesigner.

7 Ansichten (letzte 30 Tage)
Nestor Flores
Nestor Flores am 6 Mai 2021
Kommentiert: Ajiket Patil am 20 Mai 2021
I'm working on an App for calculus of an electromagnet, Already have a .m file code that is working.
I'm using something like this...
CM_A(1) = 167.800;
CM_A(2) = 133.100;
CM_A(3) = 105.600;
CM_A(4) = 83.690;
CM_A(5) = 66.360;
CM_A(6) = 52.620;
And something like this...
for i=1:13
Ro_guia(i) = 0;
Radio_guia(i) = 0;
I_guia(i) = 0;
rho_guia(i) = 0;
CM_guia(i) = 0;
end
But in appdesigner is not defined like a variable and don't know how to do it.
Also, there is a variable calculated from two variables, but program says "Matrix dimensions must agree" while both values are not matrix or arrays.
BTW... is there a complete guide on pdf for using appdesigner?
Thank you.
  1 Kommentar
Ajiket Patil
Ajiket Patil am 20 Mai 2021
In app designer variables are stored in workspace as in .m files (Since app designer uses local functions to perform tasks).
If you want to use variables in multiple functions/buttons of the app designer
properties (Access = private)
var1; % variable 1
var2; % variable 2
end
%% accessing variables elsewhere in the app designer functions
var3 = app.var1-app.var2; % computing variable 3 using defined variables 1 and 2 earlier
For Guide on app designer you may follow
https://www.youtube.com/watch?v=iga-YS6VbyE

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

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

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by