0

I have a 150x10 matrix X = zeros(150,10). If I do sum(X,2), I get the error "Subscript indices must either be real positive integers or logicals.". Can anyone help me out with that? I checked out the 'sum' function and I don't understand why this simple thing should give me any error.

Even for smaller example like A = [1 3 2; 4 2 5; 6 1 4] and sum(A,2), it gives me the required result in the MATLAB terminal however when I load my ".mat" file which has no previous variable 'A' (So I think it should not create any difference), I get on the same query an error as: "Index exceeds matrix dimensions."

Yeshi
  • 11
  • 2

0 Answers0