Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linear interpolation 2

Status
Not open for further replies.

yakpol

Structural
Jun 1, 2001
450
I am trying to perform linear interpolation for vector arrays P and M. Both arrays are defined as functions of single variable 'C'. C range is provided. Using built-in interpolation function M1=linterp(P,M,P1) gives an error: P - shall be a matrix of real numbers.
Is there a way to convert the function results into a matrix? Or perform this interpolation some other way?

Thanks!
 
Replies continue below

Recommended for you

Here it is (in MCAD 15 format) or here:
Capture_sh4pso.gif
 
I don't understand what you are trying to do. linterp accepts arguments that are VECTORS, i.e., arrays of numbers.

po and mo are clearly defined in your example as FUNCTIONS. Since you already have po and mo as functions, there is no need for an interpolation.



TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
The example I show is simplified, the real functions are more complex involving some programming, array summing and other functions. I want to store results of two functions (for x:=1..10 e.g.) in arrays so I can do interpolations between. Alternatively, I could solve equation P1=po(x) for x1 and then calculate M1=mo(x1) which is cumbersome in case of multiple calculations.
I imagined with given range of variables mathcad stores function results in arrays, just like plotting XY graph. Do I need a 'for' loop? I am just getting familiar with mathcad, so don't really know exact syntax.
 
Great! That makes all clear. Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor