Linear interpolation in Matlab

10 views (last 30 days)
Christopher Loveless
Christopher Loveless on 26 Mar 2018
Hi. I am a former Mathcad user and need help to better understand how to use linear interpolation in Matlab.
I want to create two linear interpolation functions, for use in an integral, based on two sets of data. In Mathcad, I could use a function (linterp) to make a linear interpolation based on x,y data across all real inputs for an assigned variable (e.g. SP(Z) = linterp(X,Y,Z)). Next, I could then make a definite integral that incorporates the linear interpolation function (e.g. Integrand from Z2 to Z1[C*SP(Z)dZ]). Last, I could then take my integrand, that provided an output based on assigned values to Z2 and Z1, and write it into a function dependent on a separate variable (time in this case).
I do not have a coding or math background and the above (in Mathcad) was mostly used to generate values for different models.
I'm not sure if this is possible in Matlab but any help or advice would be great. At this point, I've read through a lot of the help files but the learning curve to go from Mathcad to Matlab seems a little steep.
I did not include any code as I'm unsure of an initial starting point.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!