Interpolating
Interpolating
(OP)
Hello,
I have to vectors (flow and pressure).
I am scatter plotting them (flow vs pressure). I did it before, I do not recall how I interpolated around for a certain value of let say pressure and have the flow value on that specific point...
hope anyone can help me, thanks
I have to vectors (flow and pressure).
I am scatter plotting them (flow vs pressure). I did it before, I do not recall how I interpolated around for a certain value of let say pressure and have the flow value on that specific point...
hope anyone can help me, thanks





RE: Interpolating
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Interpolating
I will try tomorrow morning
RE: Interpolating
use "polyfit" for the latter
M
--
Dr Michael F Platten
RE: Interpolating
RE: Interpolating
Personally rather then worrying about that syntax I would rather just write the formula. Then you can do the same thing in Matlab or Maple or whatever. Math works in any language.
Step 1: What is the slope of a line passing through two points: (X1,Y1) and (X2,Y2).
Think about it before you read the answer.
Answer: slope = (Y2-Y1)/(X2-X1)
Step 2: How do I use that slop to find the value of Y at some arbitrary X in the interval (X1,YX)?
Think about it before you read the answer.
Answer:
Y = Y1 + slope * (X-X1)
Sorry I am not trying to be a jerk. It is something you should spend time understanding (rather than memorizing) imo.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
CODE
Dim pointer As Integer
Dim XO As Double, YO As Double, X1 As Double, Y1 As Double
pointer = Application.Match(LookupValue, KnownXs, 1)
XO = KnownXs(pointer)
YO = KnownYs(pointer)
X1 = KnownXs(pointer + 1)
Y1 = KnownYs(pointer + 1)
InterpL = YO + (LookupValue - XO) * (Y1 - YO) / (X1 - XO)
End Function
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
Use interp1 for simple interpolation like you are talking about.
Interp2 is for 2-d interpolation.
There is a lot of help in the help
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Interpolating
- Steve