Effacer les filtres
Effacer les filtres

code writing+fitting data with polynomial

1 vue (au cours des 30 derniers jours)
milad babaei
milad babaei le 4 Août 2011
HI,
would someone plz help me how can i use this written script to make a code,fitting my data?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
my data definition :
BoverH=1:8;
phi=0:10:30;
mydata = [ 1 1.02 1.11 1.21 1.3 1.4 1.59 1.78; ...
1 1.11 1.35 1.62 1.95 2.33 3.34 4.77; ...
1.01 1.39 2.12 3.29 5.17 8.29 22 61; ...
1.13 2.5 6.36 17.5 50 150 1400 14800];
h=log(mydata);
y=phi;
x=BoverH;
z=h;
......................................................
and the link of polynomial fit function which i would like to use :

Réponse acceptée

Walter Roberson
Walter Roberson le 4 Août 2011
order = 3; %salt to taste
[X, Y] = ndgrid(BoverH, phi);
Z = h.';
coeffs = fit2dPolySVD(X(:), Y(:), Z(:), order);
You should double-check the X and Y pairs to be sure that I got the right matching order for Z(:)
  1 commentaire
milad babaei
milad babaei le 4 Août 2011
for 3th orde we have 10 coeff. if i want to male the equation how could i arrange thoese coeff. * X AND Y??TO EVALUATE POLYNOMIAL

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by