I have a logical matrix (IdxReturns) with the dimension (589×693) which I would like to apply when calculating the product of my return series (MyReturns). However, when I attempt to apply the logical matrix I get a 9387×1 matrix. How do I go about getting around this? I am using a command that looks like the following:
TempReturn = prod(MyReturns(IdxReturns),2);
Because I am calculating the product function across the rows, I would expect a 589×1 matrix as a result. What am I doing wrong? Do I need to apply the logicals separately?
Best Answer