How do you split a data set into multiple groups within the GUI?
Show older comments
I have two list boxes. The first one contains a list of data variables. For example if my data were:
A = [1; 2; 3; 4; 5]
B = [5; 4; 3; 2; 1]
C = [6; 7; 8; 9; 0]
D = [0; 9; 8; 7; 6]
data = [A B C D]
Then the first listbox contains a list {A; B; C; D}.
If the user selects A and C and click a push button to group these sets of data to create a matrix with two columns (e.g. [ 1 6; 2 7; 3 8; 4 9; 5 0] how do I call that 'Group 1' within the second listbox?
Followed by selection B becoming 'Group 2' upon clicking the same push button.
And selection D becoming 'Group 3' upon the click of the same push button.
So the second listbox would contain a list [Group 1; Group 2; Group 3] where Group 1 corresponds to the data of A and C, Group 2 corresponds to the data of B, and Group 3 corresponds to the data of D.
2 Comments
Image Analyst
on 14 Dec 2017
listboxes contain cell arrays of strings, not collections of numerical double arrays. So does your first listbox contain {'A'; 'B', 'C'; 'D'} Or does each string contain the numbers? What do the groups look like? How do they appear to the user? Can you mock up a screenshot of what you want this to look like?
Answers (0)
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!