**Problem :**

I am currently trying to run my code but found the really annoying problem which I am unable to solve.

The function that I am currently working out is as below;

function myout = MyCointPairs(MyPriceMat, MySymbols)

myout=[];

MyNofStocks = size(MyPriceMat, 2);

MyCointMatrix= zeros(MyNofStocks);

[rows, cols] = find(MyCointMatrix);

MyCointPairs = [rows, cols];

**mycf= (MyCointPairs(:,1)-MyCointPairs(:,2))==0;**

MyCointPairs(mycf,:) = [];

if(isempty(MyCointPairs))

warning('No Cointegrated Pairs Found Here')

return

end

end

And the problem generally occurs at below line:

mycf= (MyCointPairs(:,1)-MyCointPairs(:,2))==0;

Saying that the **"Subscript indices must either be real positive integers or logicals."** And the input variable "MyPriceMat" is the price matrix of 60x10, and "MySymbols" is the 10x1 string.

One more doubt from my side what are "Subscript indices"?