>> whos Y
Name Size Bytes Class Attributes
Y 3x3 72 double
>> whos Yold
Name Size Bytes Class Attributes
Yold 3x3 72 double
When I checked it-
Y =
-0.0249 -0.0056 0.0004
-0.0188 0.0005 0.0065
-2.6337 -0.4761 0.2366
And
Yold =
-0.0249 -0.0056 0.0004
-0.0188 0.0005 0.0065
-2.6337 -0.4761 0.2366
Now find the error(i)
>> abs(Y-Yold)
ans =
0 0 0
0 0 0
0 0 0
In each iteration the error (err) will be same because, you cpoying Y to Yold, abs(Y-Yold) becomes 0
Yold=Y;
err(i)=abs(Y-Yold);
Now you want to save 3x3 (Y-Yold) zero 2D vector (matrix) in an err array, which is not permissible.
May be (not Sure): As per my observation the err(i) should have numeric value. Please debug the code from back onwards, why the Y return as 3x3.
Hope you get the issue.
Best Answer