I have an array1 (4x3x5) of probabilities. I constructed a second array2 corresponding of probabilities to find some values,for each value in array2 I look in the array1 of probabilies at the same index to know the probability to find the value.

Now the problem is that, in array2, some of the values are duplicated. So first I have to remove all the duplicated values, and to recalculate the probabilities of the new unique values by calculating the sum of the probabilities in the second column where the value is the same in array1.

This is all what I find :

uniqueC = unique(C); to calculate the unique elements of the array.
I tried to do manipulations like this :
n = histc(C(:), uniqueC, 1);

if you want to remove the duplicate, what are you going to replace it with? what's the problem with duplication? I don't really understand. Please give an example of a sample C array that is undesirable and also say how you want to make it desirable so we suggest comments on how you do it.

So to get this straight, if you have more than one of the same value (lets say 50000), then you must add up the sum of the percentages corresponding to it? If this is the case, then it might be easier to think about it you put all probabilities into one large column, and all the corresponding values into another large column. This will make it easier to find all duplicate values. This also makes it easier to delete the multiple values, because you don't have to worry about keeping the same number of rows and columns in a matrix.