How to find value of function for array of inputs ?
19 views (last 30 days)
Show older comments
Lets say f(x) is user inputed function and I have some values of x stored in array, Now I have to find the value of the function for each value of x.
i.e, if I have f(x) as x*2 [This is user-input]
then If i have x = [1,3,4,6]
and I need an other array which the value of f(x)
y= [1,9,16,36] as my answer.
Is there any function that will let evalute the same at once ?
0 Comments
Answers (1)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!