Hi all,
Is it possible to write a script to make MATLAB look at the first two columns of a matrix, and if there are multiple rows where Column 1 and Column 2 have the same values, to put these rows together and sum the corresponding values of a third column.
An example would be like this;
[a x 2;a x 3;b x 4;a y 5;b y 6;b y 7;c y 8]
and so the script will recognize there are two rows with a in column 1 and x in column 2, so it will put them together and add the values in the third row.
So the output would be like this;
[a x 5;b x 4;a y 5;b y 13;c y 8]
Forgive my bad formatting of the matrix, but any help will be greatly appreciated!
Kind regards
Willem
Best Answer