How can I get the equation of 3D interpolation?

조회 수: 1 (최근 30일)
Izan Segarra
Izan Segarra 2019년 3월 5일
편집: Matt J 2019년 3월 5일
I'm trying to get the equation of 3D interpolation but i don't know how to do it. ¿How can I get the equation?
Currently I'm getting the values putting F(x,y) in the command window.
x = [470;470;470; 1000; 1000; 1000;];
y = [1;2;3; 1;2;3];
z = [-2.68;-0.98;-0.55;-1.42;0.36;0.8];
scatter3(x,y,z)
F = scatteredInterpolant(x,y,z);
[xq,yq] = meshgrid(470:1000,1:3);
vq1 = F(xq,yq);
plot3(x,y,z,'mo')
hold on
mesh(xq,yq,vq1)
legend('Sample Points','Interpolated Surface','Location','NorthWest')
  댓글 수: 4
Matt J
Matt J 2019년 3월 5일
The equation is a very complicated piecewise linear surface. How would it help you to have an equation? Why isn't
vq=F(xq,yq);
sufficient to evaluate the surface wherever you want?
Izan Segarra
Izan Segarra 2019년 3월 5일
I am making some measurements with differential probes. The results that we are obtaining are generating a lot of error of noise of the electrical installation. Then a study of these results has been made and it is possible to make a compensation to eliminate the noise, but it is necessary to interpolate all the obtained measurements and find an equation for its correction.
I have 4 data vectors:
  • Current vector = [1 2 3]
  • Impezanze vector = [470 1000]
  • Frequency vector = [8 9 10 11 12 15 16]
  • Error vector
The error vector contains the error for each impedance at each frequency and for each current, so I need to perform a 4D interpolation and get the equation to correct the measurement error.
I had started with a 3D interpolation and 6 points to understand how to perform the process. Could you help me get the equation?

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2019년 3월 5일
편집: Matt J 2019년 3월 5일
I think you want griddedInterpolant instead:
F=griddedInterpolant({current,impedance,frequency}, Error);
Now just use it to evaluate the error at any combination of current, impedance, and frequency of interest,
error_q=F(current_q,impedance_q,frequency_q);
You do not need to fit an equation to your original data.

추가 답변 (1개)

darova
darova 2019년 3월 5일
Try interp2 or fit

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by