I have some matrix valued functions that that I can only define piecewise. Unfortunately I have some problems to manipulate those functions. Piecewise sees to do the job for scalar valued functions. There I can easily differentiale and add results. For Matrix valued functions however, those features seem to not be availible.
I can work around these limitations by manually applying all operations to the operands of the piecewise function. Like I show here:
I think my workaround is very cumbersome and error prone. Is there a better way to tackle this probem? Or should I try to overload all needed operations, and is this even possible?
Thanks for all suggestions!