I face the error of "In an assignment A(I) = B, the number of elements in B and I must be the same" when i want to create a loop a matrix. my simple short code given below, plz help me?
1 view (last 30 days)
Mahdi on 3 Jun 2014
p(i) is one element, but you are trying to tell it to store multiple values, one of the following would fix your problem (Just replace it):
p(i,:)=[x1-x2 x3-x2; x2-x3 x1-x3]
p(:,i)=[x1-x2 x3-x2; x2-x3 x1-x3]