MATLAB: Do the EditField / TextArea not get updated

appdesignereditfieldMATLAB

Hello everyone,
I am currently writing an app with AppDesigner to plot some variables.
I have a ListBox containing the variable names I have listed in a table. In that table I also have the path information of the variable.
I am trying to display that path information in a TextArea or in an EditField, however they stay empty.
I've tried to solve this with these lines in the ListBox-function
function VariablesListBoxValueChanged(app, event)
app.VariablesListBox.ItemsData = 1:length(app.VariablesListBox.Items);
SelectNum = app.VariablesListBox.Value;
load s; % s is the table which I already loaded with another button
SelectPath = s.Y(SelectNum).Path;
set(app.VariableTextLabel, 'Text', SelectPath);
app.VariablePathTextArea.Value = SelectPath
save SelectNum;
save SelectPath;
end
and with these ones in the PushButton-function
function ShowButtonPushed(app, event)
load s;
load SelectNum;
load SelectPath;
set(app.VariableTextLabel, 'Text', SelectPath);
end
but nothing seemes to be working.
I am very helpful for every piece of advice. Many thanks in advance!

Best Answer

The save command saves your workspace into file called SelectNum, maybe without file format, I can't verify this now.
You can have SelectPath as a property of the application, declare it at the beginning and change the line in the first callback to
app.SelectPath = s.Y(SelectNum).Path;
In the second callback, this should do it.
function ShowButtonPushed(app, event)
app.VariablePathTextArea.Value = app.SelectPath % This updates the text area (white space)
% app.VariableTextLabel.Text = SelectPath % This updates label (description)
end