equation with 90 degree bend
Afficher commentaires plus anciens
Using fitype in curve fitting toolbox I would like to fit a dataset of a known shape to scattered data. The shape is that of a linear line of slope 1 with a 90 degree bend resulting in a slope -1. For the life of me I can't write a proper equation to do the job. Can someone help?
1 commentaire
Ian Burelle
le 11 Sep 2015
I don't think there is a continuous smooth equation for that. It would have to be piecewise.
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 29 Août 2015
Modifié(e) : Walter Roberson
le 29 Août 2015
0 votes
What is an "equation" for this purpose? The derivative is clearly not continuous so you cannot write in terms of linear functions or exponential or trig.
If equation allows Heaviside you could use that to code the piecewise contributions.
Are you aware that fittype() does not require an equation? You can pass it an anonymous function http://www.mathworks.com/help/curvefit/fittype.html#inputarg_anonymousFunction
And really what that means is that you can pass a function handle. Including a handle to a real function that uses logical indexing to determine which case applies for each input value.
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!