Sometimes MatLab gives me answer in piecewise notation, like this:
piecewise([1 < x, 0], [abs(x) < 1, -(log(x - 1) - 1)*(x - 1)])
Is it possible to take any pair from answer?
For example, take second pair from previous answer (will be -(log(x - 1) - 1)*(x - 1)).
P.S. I using Symbolic Toolbox in this case.
From the online MATLAB R2014b documentation :
In your example,
pwould be your original answer, andiwould be 2. You can also access the condition of a branch usingcondition(p, i), the whole branch bybranch(p, i), or the number of branches bynumberOfBranches(p).