Message Boards Message Boards

GROUPS:

Unexpected results from Interpolation function?

Posted 6 months ago
1050 Views
|
4 Replies
|
3 Total Likes
|

Hello, I'm a new user of Wolfram Mathematica, I don't understand why the "interpolation" function is producing different results given the code below?

POSTED BY: Joseph Mbayi
4 Replies

Every time you call RandomReal it generates new values by default. If you need the same sample for both Inputnoise and i2 you can store the Table in a variable and then use it repeatedly.

POSTED BY: Gianluca Gorni
Posted 6 months ago

Apart from Gianluca's explanation, this expression cannot be evaluated

i2 = Interpolation[
 Table[RandomReal[NormalDistribution[1, Sqrt[w]]], 3*noisefreq]][(3*noisefreq - 1) t/3 + 1]

Interpolation returns a function that takes a numerical value within its domain, and this is not a numerical value

(3*noisefreq - 1) t/3 + 1
POSTED BY: Rohit Namjoshi
Posted 6 months ago

The symbolic variable {t} will be substituted for numeric value by other functions such as plot or Table, but thanks, I resolved the issue @Rohit Namjoshi

POSTED BY: Joseph Mbayi
Posted 6 months ago

Thanks, I totally overlooked that @Gianluca Gorni

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

Group Abstract Group Abstract