matlab如何求拟合曲线的导数,对数据点进行多项式拟合,求拟合出的函数的导数出问题了......

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

代码:

x=0:0.5:9.5;

y=[379.1 369.9 360.9 351.7 343.8 336.4 330 324.4 320.5 319.1 318.2 317.4 316.7 316 315.4 314.7 313.9 311.5 302.6 294.1];

p11=polyfit(x,y,11);

f11=poly2str(p11,'x');

x1=0:0.5:9.5;

y11=polyval(p11,x1);

plot(x,y,'rp',x1,y11)

z11=diff(f11,1)

报错:

Warning: Polynomial is badly conditioned. Add points with distinct X

values, reduce the degree of the polynomial, or try centering

and scaling as described in HELP POLYFIT.

> In polyfit at 80

In Untitled at 3

??? Error using ==> sym.sym>expression2ref at 2408

Error: Unexpected 'identifier' [line 1, col 12]

Error in ==> sym.sym>char2ref at 2378

s = expression2ref(x);

Error in ==> sym.sym>tomupad at 2147

S = char2ref(x);

Error in ==> sym.sym>sym.sym at 102

S.s = tomupad(x,'');

Error in ==> char.diff at 9

y = diff(sym(f),varargin{:});

Error in ==> Untitled at 8

z11=diff(f11,1)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值