Mathematica - get value of function at certain x

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
skrat
Messages
740
Reaction score
8
Hi,

I am not really sure this is the right topic to post my question in, but it is homework so...

To my data in txt file I fitted a function ##f(x)## where ##x\in [0,100]##. In the original file I had only 100 points, but now that I have a nice polynomial fit, I can get infinite number of points (on that function).

And that is exactly what I want to do. For example:

Code:
f[0.5]
returns me coordinates. (The argument in the code is parametrization of the fitted function from 0 to 1)

Now my question is:

From 100 original points, I need 800. And I have those 800 parameter values exactly defined in another txt file, let's call it values.txt. So the question is: How do I tell Mathematica to evaluate the fitted function at all the parametrization values in values.txt file? :/

Hopefully you understand what I need. I know it is simple, but I can't find it anywhere.
 
Last edited by a moderator:
Physics news on Phys.org
First - I believe this belongs in one of the homework threads - and someone should move it.

I don't have Mathematica handy, but once you read the 800 values into an array, I believe you can just f[data_array] and it will generate an array of 800 values, each of which is f applied to an element in data_array.
Try it out, I can't.
 
This topic can be REmoved, not only moved. I found a solution on Mathematica community.

Thanks anyway!