More Related Content
More from Tsuyoshi Horigome
More from Tsuyoshi Horigome (20)
関数の近似方法(MATLAB)
- 2. 2
>> n=8
>> x=[0 0.5 1 1.5 2 2.5 3 3.5];
>> f=sin(x).*exp(-x);
>> p=polyfit(x,f,n,-1);
>> p=polyfit(x,f,n -1);
>> xi=-0.2:0.1:4;
>> plot(xi,polyval(p,xi), '-',x,f,'o');
>>
入力