From: Aleksandar P on
Hi all,
I have been using Mathematica for a while and I just started using Matlab. Needless to say the transition is quite painful.
I need to differentiate a piecewise function (which I have created using piecewise.m), but I cannot be able to do it. So how can one differentiate a simple function like

y = sin(x) for 0 < x < 1
and y = x for 1 < x < 2

Any help will be greatly appreciated.
~Alex