How to do an interpolation on a matrix?

Hello, I used acceleration and position sensors to measure average walking pace. I entered the values ​​in the acceleration time table into variable X, to perform an interpolation, but I get an error
x=timetable2table(Acceleration,'ConvertRowTimes',false);
tmax=50;
t=0:0.1:tmax;
TS=0.05;
steps=interp1(t,x,TS);

1 Comment

hello
I don't think that interp1 works directly on tables
try convert x to array using table2array

Sign in to comment.

Answers (1)

You can convert table to array using table2array. You can access the column of table using x.(1).
x=timetable2table(Acceleration,'ConvertRowTimes',false);
tmax=50;
t=0:0.1:tmax;
TS=0.05;
steps=interp1(t,x.(1),TS);

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Release

R2020a

Asked:

on 14 Dec 2021

Answered:

on 14 Dec 2021

Community Treasure Hunt

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

Start Hunting!