How can i program the location function of x depending on the time?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to calculate the different position x(T), with the eq. below, at time T. Where x(0) is the position at tome t=0. and N is the number of sensor readings. ax(n) describes the acceleration at reading n.
Given is the T = Timematricx (N*1) and ax(n) = Accelerationmatrix (N*1). Also N, the number of sensorreadings is given. x(0) is also defined.
The goal is to have at the end a postion vector (N*1) Matricx! So how can i write a function/ script to reach the goal?
![lol.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242770/lol.png)
Respuestas (1)
Pranjal Kaura
el 30 de Ag. de 2021
Hey,
It is my understanding that you want to develop a function to find x(T) using the given formula
Here is a code snippet:
function xT = calcPosition(x0, T, Ax, N)
xT = x0 + T.*T*(sum(Ax)/N);
end
0 comentarios
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!