Hi im not sure to how to use a pointer for this script, i am trying to call the value from the previous from the previous function and use it in the main function as shown;
Any help would be grateful
Code:
void prioriestimate ()
{
int T = 1;
int i = 0;
int j = 0;
int k = 0;
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}};
{
double a[6][6];
double a_p[6][6];
for(i = 0; i < 2; i++)
for( j = 0; j < 4; j++)
for( k = 0; k < 3; k++)
a[i][j] += A[i][k] * A_t[k][j];
for(i = 0; i < 2; i++)
for( j = 0; j < 4; j++)
for( k = 0; k < 3; k++)
a_p[i][j] += a[i][k] * P_k[k][j];
}
}
int main(double Q[6][6], int i, int j, int k)
{
Pk = a_p + Q;
for(i = 0; i < 2; i++)
for( j = 0; j < 4; j++)
for( k = 0; k < 3; k++)
Pk[i][j] += a_p[i][k] + Q[k][j]
return;
}
}
Comment