Azzera filtri
Azzera filtri

Properties not getting saved in MATLAB App Designer

3 visualizzazioni (ultimi 30 giorni)
RM
RM il 21 Apr 2017
Modificato: Brijesh Shah il 31 Lug 2018
I need to use some variables across my app. For this i am saving them as public properties as follows :
properties (Access = public)
ImageDir = dir('.\Images') ;
ImageName ;
end
However, when i am saving the app or trying to run it. the properties seem to disappear :
properties (Access = public)
Property % Description
end
Can someone please tell why this could be happening. I am currently using Matlab R2017a

Risposte (2)

Melissa Williams
Melissa Williams il 16 Ott 2017
Please contact the help desk and if possible provide your app so we can investigate further.

Brijesh Shah
Brijesh Shah il 31 Lug 2018
Modificato: Brijesh Shah il 31 Lug 2018
Please discard following problem, as It was own bug, and now solved. What mistake i was doing was, 'i was loading a matfile which included all the workspace variable-including 'app'.-this matfile was saved during previous operation. Hence, all the update in properties of 'app' was undone when I loaded matfile inside , MakePlotsButtonPushed. - rookie mistake. I guess this may be the case with some. -----------------------------
Exact Same Problem , pls help, when trying to access, snips of the code is below.
properties (Access = public)
N1val % Value of N1 rpm in fraction
... % several other properties like this.
plotTransientVariableName
plotTransientVariableStatus
end
function startupFcn(app)
% some script which doesnt involve the property of interest
app.plotTransientVariableStatus=[0,0,0,0,0,0,0,0,0,0,0,0,...
0,0,0,0,0,0];
end
function MakePlotsButtonPushed(app, event)
% some script which doesnt involve the property of interest
if app.plotTransientVariableStatus(1)==1
plot(timeVec,n1)
end
end
  1. Properties defined with public access such as 'N1val' are having all the values be it double or vector or char string, except last two 'plotTransientVariableStatus' etc.
  2. This last property is initialized in startupFcn, as shown above.
  3. Its values changes with 'Statebutton' valueChanged function. - in debug, at this point vector 'plotTransientVariableStatus' still exist.
  4. 'MakePlotsButtonPushed' is generated as call back to one push button. at the if statement, matlab thorws error as index exceeds. - on debug mode it is found that inside this function this property is completely empty. - '[]'.
  5. probably, 'plotTransientVariableStatus' is not getting passed to the 'MakePlotsButtonPushed' but all other properties of app is getting passed.
pls help.

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by