필터 지우기
필터 지우기

How to get the expression of a 3d surface

조회 수: 2 (최근 30일)
柯 李
柯 李 2022년 3월 16일
답변: John D'Errico 2022년 3월 16일
hello,guys ! I have a 3d surface of a laser intensity distribution, how can get its mathematical expression? or how can get the data points from this 3d surface, and then I can use the curve fitting toolbox.

답변 (2개)

Walter Roberson
Walter Roberson 2022년 3월 16일
I have a 3d surface of a laser intensity distribution, how can get its mathematical expression?
If what you have is a finite discrete set of finite precision data, then there is no mathematically way to "get its mathematical expression". There are an uncountable infinity of mathematical expressions that fit any finite set of finite data exactly (to within round-off error.) As usual, when there are an uncountable infinity of possibilities, the probability that any one of them is the "right" version is 1 / infinity ---> zero
If you have a finite set of models with a finite number of parameters, you can do curve fitting to try to figure out which of the models fits "best". However, in practice it is common for the analysis to be dominated by round-off error; if you play off a number of different models against finite data generated by a known process, it is not at all unusual for a different model to arrive at a lower numeric residue than the one known to have generated the data.
If what you have is a finite list of scattered x, y, z values, then you can use griddata() or scatteredInterpolant and query the result at a grid of locations in order to draw the result. However, you would not want to put the result through the curve-fitting toolbox: you would be fitting the interpolation model rather than the data.
The Curve Fitting Toolbox is happy with column vectors of scattered x, y, z values.

John D'Errico
John D'Errico 2022년 3월 16일
Congratulations! You are the one millionth person to ask this same question. Your reward for this is a one way, unpaid trip to Newark, New Jersey. Yes, you need to pay for it yourself, and make all arrangements. One way, since once there, why would anyone want to leave?
Seriously though, you are not the first person to suffer this delusion, that there is a single unique function that represents any set of data points, and that, somehow, it can be found. As a simple counter-example, consider the following three points:
x = [1 2 3];
y = [2 4 6];
Yes. I know. You are willing to guess what the function is. Sorry, I'll bet you are wrong in how they were generated. In fact, I used the following function:
Y = @(X) X.^3 - 6*X.^2 + 13*X - 6;
Y([1 2 3])
ans = 1×3
2 4 6
fplot(Y,[0,4],'b')
hold on
plot(x,y,'ro')
So, is the true functional relationship the cubic polynomial I wrote, or, is it y = 2*x?
In fact, there are infinitely many different functions one can find for any set of data points, and no way to know which one is correct.
And if you have some general measured set of data points from some experiment, then at best you can hope to approximate them, IF you know of a reasonable model for the process. But you will need to provide the model.
(Enjoy your trip to Newark.)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by