1

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?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
user5266
  • 11
  • 1
  • 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 04 '13 at 02:07

1 Answers1

3

You can use Map:

draw[a_, b_] := Plot[Evaluate[f[a, #, x] & /@ b], {x, 0, 5}]
halmir
  • 15,082
  • 37
  • 53