Support
Quality
Security
License
Reuse
kandi has reviewed cftool and discovered the below as its top functions. This is intended to give you an instant insight into cftool implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Get inputs and outputs for a specific problem on Codeforces/URI
QUESTION
cftool not fitting on custom fit
Asked 2021-Jan-21 at 15:38I'm trying to do a fit on cftool for a basic oscillator. The problem is that Matlab won't make a fit; it keeps drawing a straight line. I've been experimenting with the starting points and limits, but to no avail.
The problem is probably something trivial, but I can't figure out the problem.
Current fit:
ANSWER
Answered 2021-Jan-21 at 05:43You are using custom equation y = f(x) = a * exp(-b*x) * sin(dx+e) + c
.
Matlab understands dx
inside the sin
above as a constant coefficient, so you have the sin
of a constant, which is a constant number itself.
cftool
is left then trying to approximate a sinusoidal motion with f(x)
, which at this point is a custom exponential function of the type const * exp(-const * x) + const
, so the best it can do is to yield the mean value, that is, ~0.176
.
In order to correct this, just substitute d*x
for dx
inside the sin
in your custom function.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source