I was able to also expand every node with the subsubstructs. Depending on the selected node, the corresponding data from the struct will be displayed at the plots.
myStruct = load('data_all.mat');
fNames1 = fieldnames(myStruct);
for i=1:numel(fieldnames(myStruct))
category(i)=uitreenode(app.Tree,'Text',string(fNames1(i)));
fNames2 = fieldnames(myStruct.(string(fNames1(i))));
for n=1:numel(fieldnames(myStruct.(string(fNames1(i)))))
uitreenode(category(i),'Text',string(fNames2(n)));
end
end
app.myStruct =myStruct;
function TreeSelectionChanged(app, event)
selectedNode = app.Tree.SelectedNodes;
x = app.myStruct.(selectedNode.Text).time;
y1 = app.myStruct.(selectedNode.Text).current;
y2 = app.myStruct.(selectedNode.Text).voltage;
plot(app.UIAxes,x,y2);
app.UIAxes.YLim = [0 22];
plot(app.UIAxes2,x,y1,'r');
app.UIAxes2.YLim = [-2 2];