How to make a parabolic interpolation?
Show older comments
Hello,
I have 3d graph as follow:
image1=imread('image.tif');
mu=[]
for i=1:30
for j=1:30
mu(i,j)=image1(i,j);
end
end
fmu=fft2(mu);
fmu(1,1)=0;
fmu2=fmu.*conj(fmu);
ps=ifft2(fmu2);
z=ps(1,1);
ps=real(fftshift(ps/z));
x=-15:1:14
y=-15:1:14
i=1:1:30
j=1:1:30
Z=ps(i,j)
[X,Y] = meshgrid(x,y);
surf(X,Y,Z)
set(gcf,'color','w') % pour les bordures.
xlabel('x (pixels)','FontSize',12, 'FontName','Times New Roman')
ylabel('y (pixels)', 'FontSize',12,'FontName','Times New Roman')
zlabel('Autocorrelation function', 'FontSize',12,'FontName','Times New Roman')
I want to make a prabolic interpolation in the vicinity of the maximum using the following equation :
Z=1-(a*x²+2b*x*y+c*y²)
How to make a parabolic interpolation? and how to get the parameters a, b and c?
Thank you for help.
Answers (2)
Sulaymon Eshkabilov
on 30 Oct 2019
0 votes
Hi,
An easy solution is to employ the toolbox: cftool of MATLAB.
- Launch it: >> cftool
- Select X data: X
- Select Y data: Y
- Select Z data Z
- Fir model type: Polynomial
- Degrees x: 2
- Degrees y: 2
- You will get the fit model
Good luck
1 Comment
John D'Errico
on 30 Oct 2019
Actually, no. Selecting 2nd degree for both x and y there will NOT yield the model the OP has asked to get.
Sulaymon Eshkabilov
on 30 Oct 2019
Edited: Sulaymon Eshkabilov
on 30 Oct 2019
0 votes
Hi,
An exact custom equation as asked in the question can be attained on step 5 Fit Model Type selection via Custom Equation (from drop down options) and manual entry of:
1 -( a*x^2 + 2*b*x*y+c*y^2)
Good luck.
Categories
Find more on Linear and Nonlinear Regression 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!