fitting only continous line
Show older comments
HI
I have a plot of coninouts lines(from top 1,3,6) and discontinous lines. I like to retrieve only the continous line. How can i achieve it using polyfit. Please note that slope of continous and discontinous line is same.
Please see attached image
thanks
4 Comments
Mathieu NOE
on 10 Nov 2020
hello
you have a fist code and data to share ?
salman abbasi
on 10 Nov 2020
John D'Errico
on 10 Nov 2020
Please don't ask the same question a third time. You've not gotten an answer to either question becuase it is not clear what you want. Vague questions tend not to get answers, or if they do get an answer, it will be slowly arriving, and probably not on-target.
You cannot use polyfit to fit a picture of a line. If you plotted the data, then pass the data for the line into polyfit. This is trivial. So your question seems not to be a problem of "fitting" a line, but of finding the data to fit.
You have said you want to fit only the continuous lines. But the fact is, any picture of a line as you have it is NOT continuous, but a discrete pixelated approximation to a line. And if you have plotted points, then again, it is a discrete set of points. So there is no such thing as a continuous line in any of what you have shown. If you can extract a specific set of points, then perhaps you may decide some measure that would disambiguate between points that are sufficiently close together to be effectively continuous. But that is a completely different question, totally unrelated to any question of fitting. This would become a pre-processing problem.
What you probably need to do is first, come up with a scheme that will extract the data you care about, and somehow decide which lines are ones you like and which are not. Only then does this become a problem about modeling. And it ertainly is not a question about MATLAB, not until you have some idea what you really need to do.
salman abbasi
on 10 Nov 2020
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!