How can I calculate the integral as shown in the screen shot,
where j1
is a 1x3
matrix and j2
is also a 1x3
matrix,
while g1
is a 300x3
matrix and also g2
is a 300x3
matrix.
In the screen shot the '.' represents the dot product.
Actually g1 and g2 are 300x4 matrix where 1st row is of 't'. and 1st row has t = 200 and 2nd row has 300 and so on till 300th row has 60000 value. So, g1 and g2 is actually dependent on 't'. if we take it as summation then would this be correct ?
Alpha_gyro = 0;
for i = 1:300
Alpha_gyro_function =(dot(g1(1,2:4),j1) - dot(g2(i,2:4),j2));
Alpha_gyro = Alpha_gyro + Alpha_gyro_function;
end
So, it gives output as 1 number. But now i am confused what would be the value of 'Alpha_gyro(t)' with respect to 't' . i.e, 'Alpha_gyro' should also be the matrix of 300x1, right ? because it is dependent on 't' for that purpose would this be correct ?
Alpha_gyro = zeros(300,1)
for i = 1:300
Alpha_gyro_function =(dot(g1(1,2:4),j1) - dot(g2(i,2:4),j2));
Alpha_gyro(i) = Alpha_gyro(i) + Alpha_gyro_function;
end
But then, As we know integration has value from 0 to the new value of 't" so each value should be the sum of previous value in the new matrix. So then I added this , Can you please guide if i am doing it right ?
Alpha_gyro = zeros(300,1);Alpha_gyro_function_old =0 ;
for i = 1:300
Alpha_gyro_function =(dot(g1(1,2:4),G_upd_j1) - dot(g2(i,2:4),G_upd_j2));
Alpha_gyro_function_old = Alpha_gyro_function_old + Alpha_gyro_function;
Alpha_gyro(i) = Alpha_gyro(i) + Alpha_gyro_function_old;
end