I have an acceleration data which is collected from a vehicle. I do also have a displacement measurement.

I would like to calcuate the displacement vector from the measured acceleration data, but no success yet.

Here is the data (the previous link was not working I updated the link):
<https://ufile.io/zyw3r>

[![The measured acceleration data](https://i.stack.imgur.com/aC2bS.jpg)](https://i.stack.imgur.com/aC2bS.jpg)

[![The measured displacement data](https://i.stack.imgur.com/lbSRH.jpg)](https://i.stack.imgur.com/lbSRH.jpg)
What I try:

```
filename = ('acc_time.csv'); 
accdata = csvread('acc_time.csv');

[mydata, myheader] = xlsread(filename); 
for i = 1:length(myheader)
      % compose a command to assign each column to a variable with the same 
      % name as the header
      commandExec = [myheader{i}, ' = ', 'mydata(:,', num2str(i) , ');'];
      % execute the composed command to actually create the variable
      evalin('base', commandExec ); 
end

vel_vector = cumtrapz(time,acc); 
disp_vector= cumtrapz(time,vel_vector);
plot(time, disp_vector)

```

and I get:
[![Plot](https://i.stack.imgur.com/JagCJ.png)](https://i.stack.imgur.com/JagCJ.png)

but the displacement vector should be squiggy not like linear incremental.

Where am I wrong?