| Author |
Comment/Response |
Peter
|
04/25/11 03:04am
I have a huge piecewise function that has a very obvious pattern according to the domain. Is there a way of creating this with a loop rather than entering the data manually?
Something like
Clear[i]
i = 0;
While[i < 10,
j[x_] := i*x^3 - i*x^2 - 1 /; i- 1 <= x < i; i++]
to create -1 for -1 <= x < 0
x^3 - x^2 -1 for 0 <= x < 1
2x^3 -2x^2 -1 for 1 <=x< 2
Ultimately I'd like to Plot all of these on a single graph.
Thanks
URL: , |
|