How to plot trajectories of a project when knowing the acceleration and time

I am currently working on a project which is to plot the trajectory of an accelerometer sensor.
The data gathered from the sensor is in the format of Json. I do not even know how to read that Json file, however, what I do know is that the sensor collects acceleration in x, y, z directions respectively, and the sample rate is 10Hz.
We can simply assume the initial velocity is 0, and the object is positioned at the point (0,0,0) initially.

Respuestas (1)

Hey Hailong,
I understand you want to read sensor values from json file and then use the sensor's data to calculate trajectories.Please follow the following steps to resolve the task:
2-You can refer to 'cumtrapz' function which computes the approximate cumulative integrals that will help to velocity and then position.For more information please refer to https://www.mathworks.com/help/matlab/ref/cumtrapz.html
3-After obtaining the position values,'plot' function can be leveraged to visualize the trajectory.For more information, please refer to https://www.mathworks.com/help/matlab/ref/plot.html
Hope this helps.

Categorías

Productos

Etiquetas

Preguntada:

el 16 de Feb. de 2022

Respondida:

el 2 de Oct. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by