Afficher commentaires plus anciens
clear ;
clc;
x=0.001:0.001:0.241;
z=load('C:\Users\Administrator\Desktop\y.txt');
a=mean(z);
y=z-a;
f=@(c,x)(c(1)*sin(c(2)*pi*x+c(3)));
c0=[0.016,250,-2];
lsqcurvefit(f,c0,x,y);
plot(x,y,'.-',x,f(c,x),'r:x')
legend('原始数据','拟合数据')
错误显示: 错误使用 lsqcurvefit (line 248)Function value and YDATA sizes are not equal.
出错 Untitled2 (line 9)
lsqcurvefit(f,c0,x,y);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Legend 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!