I have a list of N functions called functionList. N can be any number. Also, I have a list called nodes whose elements are in the interval i want to plot in.
My aim is to visualise in one graphic all the functions functionList[[1]], functionList[[2]], ..., functionList[[n]] in the respective subinterval.
This means to iterate over functionList and plot functionList[[i]] in the interval from nodes[[i]] to nodes[[i+1]].
First, functionList[[1]] in the interval from nodes[[1]] to nodes[[2]].
Then, functionList[[2]] in the interval from nodes[[2]] to nodes[[3]].
I know about about
Plot[Piecewise[{{x^2, x < 0}, {x, x > 0}}], {x, -2, 2}]
but how can I combine with iterating over my functionList?
I am looking for something like this
Plot[Piecewise[{{functionList[[i]], x > nodes[[i]]&&x<nodes[[i+1]]}, {i,1,N}], {x, 0, 2}]





funs = {x, x^2}``conds = {{x < 1}, {x >= 1}}`` f[x_] = Piecewise@Transpose[{funs, conds}] /. List[a_] -> a– chris Dec 27 '14 at 15:14Piecewise@MapThread[{#1, Sequence @@ #2} &, {funs, conds}]– chris Dec 27 '14 at 15:17Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Dec 27 '14 at 15:17