Here is a sample list
data = {{1, 2.1, 55.2}, {2, 2.7, 60}, {3, 3.1, 65}, {4, 3.5, 67}, {5, 4.5, 72}, {6, 4.2, 77}, {7, 5.9, 80}}
which contains three rows.
Now, let's create another list
ti = 2.;
tf = 6.;
nmax = 200;
dt = (tf - ti)/(nmax - 1);
times = Table[i, {i, ti, tf, dt}];
So, we created a list containing 200 equally spaced numbers in the interval [2,6]. These numbers correspond to the second row of the initial data
list.
Now, I want to interpolate the initial data
list so as to be able to predict what would be the values of the first and third columns using the 200 list as a second row. So we should obtain a new list data2
containing as a second row the 200 equally spaced data from times
list and as first and third columns the interpolated ones. Finally, if possible, I would like to merge data
and data2
with ordered columns.
Any ideas?
Interpolation[data[[;; , {2, 1}]]]
? $\endgroup$data2
? $\endgroup$data2
? With this simple interpolation you can sample 1st or 3rd column with any step of the 2nd column. $\endgroup$times
and create a new listdata2
containing as a second column the 200 values and as first and third columns the interpolated ones fromdata
. Please if possible provide a detailed answer. $\endgroup$