MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES Guide de l'utilisateur Page 171

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 216
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 170
differentiate
4-95
Example Create a noisy sine wave on the interval [0, 4π].
rand('state',0);
x = linspace(0,4*pi,200)';
y = sin(x) + (rand(size(x))-0.5)*0.2;
Create a custom fit type, and fit the data using reasonable starting values.
ftype = fittype('a*sin(b*x)');
fopts = fitoptions('Method','Nonlinear','start',[1 1]);
fit1 = fit(x,y,ftype,fopts);
Calculate the first derivative for each value of x.
deriv1 = differentiate(fit1,x);
Plot the data, the fit to the data, and the first derivatives.
plot(fit1,'k-',x,y,'b.');hold on
plot(x,deriv1,'ro')
legend('data','fitted curve','derivatives')
See Also cfit, fit, integrate
0 2 4 6 8 10 12 14
1.5
1
0.5
0
0.5
1
1.5
x
y
data
fitted curve
derivatives
Vue de la page 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 215 216

Commentaires sur ces manuels

Pas de commentaire