MATLAB Answers

How to fit with case differentiation

2 views (last 30 days)
Niklas Kurz
Niklas Kurz on 4 Jul 2020
I guess this is a really tricky question and might solved with a good amount of mathmatical knowledge. But first things first:
I want to execute a fit with a custom equation in cftool. The problem remains in the fact that the function consist of case differentation:
  • atan((2*d*w)/(v^2-w^2)) for w < v
  • π/2 for w = v
  • π/2 + atan((2*d*w)/(v^2-w^2)) for w > v
with w being 'x'
Actually I got handed the solution: fitting with :
acos((v^2 - w^2)/sqrt((2*d*w)^2 + (v^2 - w^2)^2)).
But how you hade have approached that problem?


Sign in to comment.

Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!