fitting a curve on 3d data

6 ビュー (過去 30 日間)
prashant singh
prashant singh 2017 年 12 月 31 日
回答済み: Image Analyst 2018 年 1 月 1 日
i have 3d data and I have plotted it using
scatter3(data(:,3),data(:,1) ,data(:,2));
I want to plot a curve along this 3d data, something like
Also how once i have plotted i want to extend the curve and get the x and y points (data(:,1) and data(:,2)) till my z points (data(:,3)) becomes 0. z usually starts from 35 and goes till 128. once the curve is fit i want to know the x and y points corresponding to z(0:34). Uploading the data.mat.
  4 件のコメント
prashant singh
prashant singh 2018 年 1 月 1 日
@Matt the line was ok but it only covers like 10% of the data. I have a lot data like this the line wasn't as generalize solution as i thought it would be.
prashant singh
prashant singh 2018 年 1 月 1 日
@Akria Agata Yes its fine if we ignore the noisy part.

サインインしてコメントする。

回答 (2 件)

John D'Errico
John D'Errico 2018 年 1 月 1 日
編集済み: John D'Errico 2018 年 1 月 1 日
UGH. If I understand you, this curve has a set of points that follow no known model, but you want to fit them, in 3-D. So this becomes an errors in variables kind of thing, but with no known model, what must be effectively a spline is the only thing that makes sense here.
I think, if I understand what you said, that those points that are not on the curve are identifiable (and can thus be segregated from the fit) have z==0. So at least you know which points do not belong on the curve.
That first part of the curve seems to be pretty linear to me. Then there is a fairly sharp break into a curved segment. And you are telling us that you now want to extrapolate that curved segment over a moderately significant distance? Sigh. Why do I want to insert Mark Twain's comments on the dangers of extrapolation here? Worse, this is also moderately noisy data?
That is, when you use a model that can fit a curved segment there, the fit at the end (and any extrapolation that you do) will be primarily based on the last few points on the curve. So if you were able to put confidence limits around the extrapolated curve near the end, they would get very wide very quickly.
Do you know where/when the break occurs?
I might also note that it LOOKS like there are linear segments on this curve. Thus the curved region even seems to be composed of approximately linear segments. I might guess that curved region is three linear segments. But finding break points, even in a piecewise linear, but continuous curve, in three dimensions, with errors in variables is not a trivial thing.
Do you know some reason why the curve appears to have vaguely linear segments? That seems to be suggested, given that is what you drew.
Did I say UGH? Is this something you need to do ONCE? Or is it something you need to do automatically for multiple sets of data? (Please don't tell me the latter is the case.)
You have not provided the data itself. That makes me worry/wonder if this is something you will be doing multiple times. (Edit: oops, I see you did attach the data!)
For example, if I were needing to do this ONCE, I might artificially pick the breaks by eye. Once I had those points, I could at least use the last segment to fit a straight line using an SVD to do the errors in variables fit, then extrapolating that line.
  3 件のコメント
prashant singh
prashant singh 2018 年 1 月 1 日
編集済み: prashant singh 2018 年 1 月 1 日
To view the data, please switch the dimension to
scatter3(data(:,3),data(:,1) ,data(:,2));
Also you can ignore the noisy part .. i just want to fit some curve even if it covers like 50% to 60% of data. I have a lot other data like this and i want to find some generalised solution for that
John D'Errico
John D'Errico 2018 年 1 月 1 日
It does not matter what variable is plotted on which axis. That does not improve the data or make the problem simpler.

サインインしてコメントする。


Image Analyst
Image Analyst 2018 年 1 月 1 日
I thought I already answered this in your prior post. Basically you parameterize the 3 coordinates and do a fit, cleaning the data beforehand if desired. What was wrong with that solution, except that you didn't want the fitted red line to actually be plotted, which is an easy thing to get rid of?

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by