Message Boards Message Boards

0
|
2984 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Making and using a List of functions

Posted 10 years ago

How one can construct a list (array) of functions in Mathematica?

POSTED BY: Pavel AZ
2 Replies
Posted 10 years ago

Thank you

POSTED BY: Pavel AZ

Here is list of functions

  m = {Function[{x}, x^2], Function[{x}, Log[x]], Function[{x}, Sin[x]]};
  (*or if you like little less typing*)
  m = {#^2 &, Log[#] &, Sin[#] &};

To use it, an example

Plot[#[x], {x, -1, 1}] & /@ m
(*or*)
Map[Plot[#[x], {x, -1, 1}] &, m]
POSTED BY: Nasser M. Abbasi
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