I am designer an application using MATLAB App Designer. The very first panel is the home page panel which has a drop-down to allow the user to choose which age category and proceed to the set of questions that fits their age. So, I have created another 3 panels to link with the age category. The code for callback between drop down and others panels is shown below:
% Value changed function: DropDown
function DropDownValueChanged(app, event)
value = app.DropDown.Value;
% Hide all the panels
app.PanelA.Visible = 'off';
app.PanelB.Visible = 'off';
app.PanelC.Visible = 'off';
%If Panel 1 is selected, show panel 1
if strcmp(value,'Panel A')
app.PanelA.Visible = 'on';
elseif strcmp(value,'Panel B')
app.PanelB.Visible = 'on';
elseif strcmp(value,'Panel C')
app.PanelC.Visible = 'on';
end
end
However, problem occurred when I was trying to simulate the application. I got this error message: Error using DRS Error: File: DRS.mlapp Line: 94 Column: 5 Illegal use of reserved keyword "methods".
And when I put cursor on methods and it shows: "Parse error at METHODS: usage might be invalid MATLAB syntax"
The following is the code that went wrong, the very first line got an error as mentioned before.
methods (Access = private)
% App initialization and construction
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
What should I do to rectify the problem? Thank you in advanced.