How to add two different linear fits to the same graph
Mostra commenti meno recenti
I have tried looking for built-in plotting options to create a bi-linear fit for data but it appears this is something I probably have to code myself. Below I attached an example of the data I am trying to fit:

I want to be able to fit a linear regression to the 'flat' and 'steep' regions of this graph without having to manually create two data sets, regressions, and a combined plot. The point of this is to find the intersection point of the two linear regressions.
Perhaps the best way of solving the problem is to find where concavity/double derivative is maximized, however I really do not know how to go about coding this. Any ideas or help would be greatly appreciated.
4 Commenti
dpb
il 27 Ago 2018
I've posted this a couple times in the past but I don't seem to have saved a link...let me search for it and see if can find it rather than rewriting from scratch. I thought I had a utility function but don't see it now, either... :(
Joshua Everts
il 27 Ago 2018
Joshua Everts
il 27 Ago 2018
Modificato: dpb
il 27 Ago 2018
dpb
il 27 Ago 2018
How about attach a .mat file with a couple of your curves to illustrate with? I did find my piecewise m-file (it was in an old installation folder).
I don't know how well the linear section is going to work with the RH section of your data; it looks more like a quadratic might be in order.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear Predictive Coding in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
