Many sets at different intervals (Mathematica)

I need help with Mathematica. I am trying to build functions that are stored in lists, for example:

list = {{3x, 1,5}, {2x ^ 2,0,4}}

I need to get a result similar to what I entered:

Show [Plot [3x, {x, 1.5}], plot [2x ^ 2, {x, 0.4}]]

But I'm not quite sure how this is achieved?

Thanks in advance

+3
source share
1 answer

Of the many possible ways to do this, here is perhaps a critical and concise single-line font, followed by an explanation:

Show[Plot[#, {x, ##2}] & @@@ list]

Mathematica graphics

-, # Slot ## SlotSequence, f @@@ expr - Apply[f,expr,{1}]], :

Show[Apply[Plot[#, {x, ##2}] &, list, {1}]]

, - list . # - ( , , , 3x) ##2 - ( Sequence, Sequence[0, 4]). , , Plot[3x, {x,0,4}].

, Map:

plotter[{func_, interval__}] := Plot[func, {x, interval}]
Show[plotter /@ list]

, !

+6

Source: https://habr.com/ru/post/1769009/


All Articles