Being able to store multiple user selected values from a tree, MATLAB APP Designer

9 views (last 30 days)
Hello everyone! I have been trying for the last couple hours to figure out how to store the values a user would select from a tree, while also being able to pickup when the user deselects a previously selected node. I havent found much insight or previous questions on how this might be accomplished.
For instance,
If the user selects the above two options, I notice that in the app.Tree.CheckedNodes it stores a 2x1 TreeNode array with the values I need to "detect" embded within. How would I be able to scan for the user selcted data?? Bellow is the mentioned function.
function TreeCheckedNodesChanged(app, event)
checkedNodes.Text = app.Tree.CheckedNodes;
Selc = checkedNodes.Text
if contains(Selc,"3D Yield Surface")
app.Checked(1) = [1];
app.Checked(1) = 0;
if contains(Selc,'Yield Strength vs Orientation')
app.Checked(2) = [1];
app.Checked(2) = 0;
if contains(Selc,'Actual vs Predicted')
app.Checked(3) = [1];
app.Checked(3) = 0;
app.UITable.ColumnName = {app.Checked};
That app.Checked bit is just so I could check if my code was working in real time, all it is supposed to do is store if the user made the change, please let me know if you see any better way to accomplish this aswell.
Thank you again and again!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by