I am trying to multiply three arrays together;
P_temp = A * A_t * P_k
Where the size or each array is [6][6].
Having difficulty in getting the correct answer. The method i am doing is;
A * A_t = a then using the result in a to use again in
P_temp = P_k * a
Any ideas how i could simplify this at all? Any help would be greatly appreciated!!
P_temp = A * A_t * P_k
Where the size or each array is [6][6].
Having difficulty in getting the correct answer. The method i am doing is;
A * A_t = a then using the result in a to use again in
P_temp = P_k * a
Any ideas how i could simplify this at all? Any help would be greatly appreciated!!
Code:
void prioriestimate (int a1[][3], int a2[][4], int a3[][4]) { int T = 1; double A[6][6] = {{1, 0, 0, T, 0, 0}, {0, 1, 0, 0, T, 0}, {0, 0, 1, 0, 0, T}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}}; double A_t[6][6] = {{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {T, 0, 0, 1, 0, 0}, {0, T, 0, 0, 1, 0}, {0, 0, T, 0, 1, 0}}; double P_k[6][6] = {{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 1, 0}}; { int i = 0; int j = 0; int k = 0; int a; for(i = 0; i < 2; i++) for( j = 0; j < 4; j++) for( k = 0; k < 3; k++) a[6][6] += A[6][6] * A_k[6][6]; } { int i = 0; int j = 0; int k = 0; for(i = 0; i < 2; i++) for( j = 0; j < 4; j++) for( k = 0; k < 3; k++) P_temp[6][6] += a[6][6] * P_t[6][6]; } }
Comment