Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So far I've got this:

draw[a_, b_] := Plot[{f[a, b[[1]], x], f[a, b[[2]], x]}, {x, 0, 5}]

The function draw will be used like this:

draw[10, {4, 7}]

The example is written for the case with two elements in the list that is the second argument. How do I do it when the second argument is a list with any number of elements?

share|improve this question
It would help us to help you if you edited your question to include an example of kind of function you would give for f. – m_goldberg Jan 4 '13 at 2:07

You can use Map:

draw[a_, b_] := Plot[Evaluate[f[a, #, x] & /@ b], {x, 0, 5}]
share|improve this answer
+1 (see also this frequently asked question) – Jens Jan 4 '13 at 1:45
Thank you very much. – user5266 Jan 4 '13 at 11:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.