MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES Guía de usuario Pagina 171

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 216
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 215 216

Comentarios a estos manuales

Sin comentarios