It looks close to good to me. Why do YOU think there is a problem?
Hint: Read the help for the tools you will use. In this case, cumtrapz.
When there are two arguments to cumtrapz, they should be in the order cumtrapz(x,y). Again, from the help, it shows this:
Z = cumtrapz(Y)
Z = cumtrapz(X,Y)
With only one argument, so an implicit X step of 1, you just pass in Y. With two arguments, i.e., acceleration and time, they must go in the proper order.
So, if you will integrate acceleration over time,
velocity = cumtrapz(time,acceleration);
Similarly, the second integral must have its arguments in the proper order.
READ THE HELP.