Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.3K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Interpolation of an array using another array as domain

Posted 3 years ago

Hi there!

I have two Mathematica arrays: Xval and Yval.

Let's suppose a simple situation:

Xval[1]=1

Xval[2]=3

Xval[3]=5

Yval[1]=10

Yval[2]=20

Yval[3]=30

For a situation like this, where the arrays are small, I could do something like:

Func = Interpolation[{1,10},{3,20},{5,30}]

So there's no problem here. However, let's imagine that both Xval and Yval are arrays of length n which are read from a .txt file. I want to know if it is possible to interpolate Yval using Xval as the domain, without having to write explicitly the points [{1,10}...] by hand.

Cheers, M

Posted 3 years ago

If Xval and Yval are lists of the same size, then Transpose[{Xval,Yval}] will yield a list of pairs.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard