How do you split a data set into multiple groups within the GUI?

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 comentarios

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?
Keri Dalg
Keri Dalg el 14 de Dic. de 2017
Editada: Keri Dalg el 14 de Dic. de 2017
I have attached a picture of the mock up of the list boxes. The list box contains a cell array of strings (size 4X1 in this example). The data set is just a 5x4 double.
data = [1 5 6 0; 2 4 7 9; 3 3 8 8; 4 2 9 7; 5 1 0 6]
I have a code to link the A to column 1, B to column 2, etc. Thanks for your help in advance!

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Preguntada:

el 14 de Dic. de 2017

Editada:

el 14 de Dic. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by