How to get rid of sign() in diff() results?
Show older comments
I have a symbolic function. diff() produces the result with sign(). The next derivative has dirac() in it. Is there a way to get rid of sign() in the diff() result?
Accepted Answer
More Answers (1)
Image Analyst
on 6 Jun 2021
Not sure what you mean because you did not give any examples, but if you want the differences to always be positive, you can pass the results of diff() into abs():
d = abs(diff(v));
4 Comments
Paul
on 6 Jun 2021
The code as written is differentiating the magnitude of the transfer function wrt to R1? If you don't mind me asking, what is the purpose of this operation?
Or is it really intended to differentiate the amplitude of the frequency response of the transfer function wrt to R1?
Valeri Aronov
on 6 Jun 2021
Edited: Valeri Aronov
on 6 Jun 2021
Paul
on 6 Jun 2021
I read the post. Sill not clear to me that the intent is to get the derivative of H(s) wrt R1 or if the goal is to get the derivative of abs(H(jw)) wrt R1.
Valeri Aronov
on 6 Jun 2021
Edited: Valeri Aronov
on 27 Jun 2021
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
