I am trying to calculate acceleration from time and velocity using the code:
x=readtable('Drive Cycles EPA urban full.csv');V=x(:,2)T=x(:,1)A=gradient(V(:))/gradient(T(:))
I have also tried diff instead of gradient. They both return the error:
Error using test (line 4)Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts) is notsupported. Use a row subscript and a variable subscript.
Any suggestions would be a huge help.
Thank you!
Best Answer