Properties not getting saved in MATLAB App Designer

7 ビュー (過去 30 日間)
RM
RM 2017 年 4 月 21 日
編集済み: Brijesh Shah 2018 年 7 月 31 日
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
  1 件のコメント
Bharath Lohray
Bharath Lohray 2017 年 9 月 15 日
I have the same problem. Did you find a solution?

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

回答 (2 件)

Melissa Williams
Melissa Williams 2017 年 10 月 16 日
Please contact the help desk and if possible provide your app so we can investigate further.

Brijesh Shah
Brijesh Shah 2018 年 7 月 31 日
編集済み: Brijesh Shah 2018 年 7 月 31 日
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.

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by