How do I change and save Check Box name in app designer so that it loads when I restart the app next time?
I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want?I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want? I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want? app designer MATLAB Answers — New Questions