matlab lsqcurvefit函数

学习 时间:2026-04-07 20:01:09 阅读:4839
matlab lsqcurvefit函数function T = nihehanshu( x,xdata )T = 1./(x(1)*xdata + repmat(x(2),1,10) ) + repmat(x(3),1,10) ;end>> xdata = [82 38 19.8 12.9 8.5 6.1 3.7 2.5 1.73 1.14];>> ydata = [-18 -8 5 16 25 33 46 55 66 80];>> x0 = [0,0,0];>> [x,resnorm] = [@nihehanshu,x0,xdata,ydata]Error using ==> horzcatThe following error occurred converting from double to function_handle:Error using ==> function_handleToo many output arguments.x0改成 x0 = [1,1,1];

最佳回答

孤独的芒果

高高的方盒

2026-04-07 20:01:09

你用的是什么版本的matlab?确定是这种用法么?[x,resnorm] = [@nihehanshu,x0,xdata,ydata]这句显然不对啊,你用的什么工具箱都没体现出来,怎么算。我的是R2006a改成[x,resnorm] = lsqcurvefit(@nihehanshu,x0,xdata,ydata)就可以运行了建议用工具箱之前先help一下用法以后 再问: 没问题了 谢谢你

最新回答共有2条回答

  • 甜蜜的太阳
    回复
    2026-04-07 20:01:09

    你用的是什么版本的matlab?确定是这种用法么?[x,resnorm] = [@nihehanshu,x0,xdata,ydata]这句显然不对啊,你用的什么工具箱都没体现出来,怎么算。我的是R2006a改成[x,resnorm] = lsqcurvefit(@nihehanshu,x0,xdata,ydata)就可以运行了建议用工具箱之前先help一下用法以后 再问: 没问题了 谢谢你

上一篇 How many boys can you

下一篇 2.5平方电缆3相4线,最大功率为多少?