MATLAB: Is there a function that performs similar to ‘accumarry’ but multiplies instead of accumulates
arrayMATLAB
Hello all, Is there a function that performs similar to 'accumarry' but multiplies instead of accumulates? Thank you!
Best Answer
You can multiply withaccumarray if you specify theprod function as the function you want it to use. This is an adaptation of a recent Answer that wanted to take themean of values in the second column of the matrix that shared the same value of the first column, so I originally used themean function. Here, I’m multiplying them instead, using theprod function:
Best Answer