Home > other >  Index matrix dimensions beyond how to solve?
Index matrix dimensions beyond how to solve?

Time:01-08

The function of Q=Q (R, S)
Q=0; I=1:10; J=1:3;
S=[237, 125, 294, 148, 261, 271, 189, 196, 192, 114, 237, 125, 294, 148, 261, 271, 189, 196, 192, 114, 237, 125, 294, 148, 261, 271, 189, 196, 192, 114].
T=[2.5 3.9 2.1 4.2 5.4 3.5 2.6 0.7 1.9 0.3; 2.4 3 1.5 2.5 6.6 5.2 1.3 2.4 1.9; 1.5 2.5 1.2 4.5 2.8 3.6 6.2 7.7 5.9 7];
For I=1:1:10
For j=1:1:3
If R (I, j) & lt; 0.5
R (I, j)=0;
The else
R (I, j)=1;
End
Q=Q + 100 * R (I, j). * t (I, j). * S (I, j);
End
End
Index beyond matrix dimensions,

Error Q (line 12)
Q=Q + 100 * R (I, j). * t (I, j). * S (I, j);
  • Related