Properties not getting saved in MATLAB App Designer
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Melissa Williams
2017년 10월 16일
Please contact the help desk and if possible provide your app so we can investigate further.
댓글 수: 0
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
- 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.
- This last property is initialized in startupFcn, as shown above.
- Its values changes with 'Statebutton' valueChanged function. - in debug, at this point vector 'plotTransientVariableStatus' still exist.
- '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. - '[]'.
- probably, 'plotTransientVariableStatus' is not getting passed to the 'MakePlotsButtonPushed' but all other properties of app is getting passed.
pls help.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 System Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!