Question: How do I enter a piecewise for n functions

I want to create a graph from y1 to yn+1.

Something like:

f(x)=piecewise(

x<a[1],y(x)[1],

for i from 2 to n+1,

a[i-1] <=  x  <=  a[i], y(x)[i];

od:);

plot(f(x),x=0..l);

But then something that works.

Can anyone help me with an example?

 

 

Please Wait...