Hello, I have a table with two columns and a number of rows (first column contains a variable name and the second column contains its value). The entries of the first column (the variable names) has duplicates, as shown in the example below:
'x1' [1] 'x2' [2] 'x3' [3] 'x4' [4] 'x1' [2] 'x4' [8] 'x2' [5] 'x1' [5] 'x4' [1]
I would like to record the name of the unique variables as the header (without repeatitions) and their values below them. In case of few values, the last value will be repeated just to fill up the cells. From my cell array above I would like to achieve something like this:
'x1' 'x2' 'x3' 'x4' [ 1] [ 2] [ 3] [ 4] [ 2] [ 5] [ 3] [ 8] [ 5] [ 2] [ 3] [ 1]
How would I achieve this? Any Ideas? Kind regards,
Best Answer