Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.