How to make a parabolic interpolation?
Afficher commentaires plus anciens
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.
Réponses (2)
Sulaymon Eshkabilov
le 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 commentaire
John D'Errico
le 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
le 30 Oct 2019
Modifié(e) : Sulaymon Eshkabilov
le 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.
Catégories
En savoir plus sur Linear and Nonlinear Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!