I Have two set of data separately, which one of them is pressure and the other one is energy density.(P: pressure, E: energy density) I want to use these data as a function, P(E) or E(P) by utilizing an Interpolation between them. Could you please help me that how I can make a function of these data?
For instance in Matlab I wrote the codes below and they work well.
E=interp1(Data(:,2),Data(:,1),P);
P=interp1(Data(:,1),Data(:,2),E);
Regarding the codes in Matlab, I have a Matrix named Data which the first column is related to energy density and the second column is for pressure.
In fact, by the codes above in Matlab, I could give an arbitrary pressure and then the result is the corresponding energy density or vice versa.
For my Mathematica code, I separated the columns of the matrix mentioned above into two data as two Excel files. Then these two files were imported in the notebook in order to make an interpolation between them to utilize it as a function. Indeed the interpolation between energy density and pressure could work like a function which gives pressure in terms of energy density or vice versa.
My question is that how I can write such a code in Mathematica.
Attachments: