Matlab question: Data from three force sensors is recorded in forcetest.csv. The
ID: 664308 • Letter: M
Question
Matlab question: Data from three force sensors is recorded in forcetest.csv. The first column is the channel (sensor 0, 1 or 2), the second column is the voltage measurement in volts and the third column is the timestamp of the reading in seconds. Because the recordings are not exactly sychronized, use a linear interpolation to resample the reading for each sensor between 1 and 17 seconds in increments of 1/120 sec.
I am looking for steps how to do this. The forcetest.csv is an excel file that has three columns.
Explanation / Answer
file = 'mydata.csv';
M = csvread(file) --------->Reading data from csv file
v=[1/120]
x1 = (1:0.1:5); ----------->setting data
v1 = interpn(M,v,x1,'cubic'); ------------>linear interpolation
figure
plot(M,v,'o',x1,v1,'-'); ----------=>plotting the result
legend('Some data examples','Linear Interpolation');