As the title indicates, if you know how to create a list of anonymous functions in your program, please tell me.
The question is a bit vague/broad, but here’s one way:
ClearAll[powerfns];
powerfns[powers : {_?NumericQ ..}] := Function /@ (#^powers);
powerfns[{1, 2, 1/2}]
(* {#1 &, #1^2 &, Sqrt[#1] &} *)
Thank you very much. I also looked it up and found a function called ToExpression [].
When I normally evaluate ToExpression [{“# &”, “# ^ 2 &”, “Sqrt [#] &”}]
{# 1 &, # 1 \ ^ 2 &, Sqrt [# 1] &}
Actually, I want to link the value of the local variable in another built-in function to the list of this function, but this can not be done at all.
actually,
Plot [Evaluate [Table [Normal [Series [Sin [x], {x, n, 6}]], {n, 3, 3}]], {x, 0,
Pi}]
I would like x and n to work with the Series arguments.
Table [] lists functions generated by multiple Series [].
After listing anonymous functions,
Plot [{Function [x, x ^ 2] [x], Function [x, x ^ 3] [x]}, {x, 0, 5}]
You can associate with x of Plot [] by attaching [x] after an anonymous function.
But, I do not know how to add [x] to the list of anonymous functions and interlock with x of Plot [].
Thank you.
Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST
The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.
int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]
Sorry. I am Japanese.
I am using “Google Translate” because I can not write English directly.
Using “Google Translate” often causes “I” and “You” to overturn.
You can associate … → I can associate …
I apologize to you for a fuss over.
@satoshi nakagawa, please read our post above carefully. We are talking NOT about your text, but how you work with CODE on this forum. Please follow proper rules of writing and editing posts.
The explanation of the previous article may have been difficult to understand.
I just wanted to dynamically generate multiple anonymous functions and pass them to Plot [] to compare the graphs.
Can this simple thing be written in mathematica?
Thank you.
