matlab Function value and YDATA sizes are incommensurate
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 07:55:20
matlab Function value and YDATA sizes are incommensurate
M文件:function f=myfunc(D,t)syms n t; x=1/n^2*exp((-1)*D*n^2*pi^2*t/0.0002^2);s=symsum(x,n,1,100);f=1-6/pi^2*s; end主程序:t=[180 420 780 1080 1380 1680 1920 2220 2520 2820 3120 3420 3720 4020 4380 4680 4980 5280];c=[0.08762 0.20444 0.36545 0.48247 0.59 0.67602 0.75 0.80407 0.86 0.9 0.94 0.96831 0.98561 0.99 0.99968 0.999999 1 1];D0=[0.001];D=lsqcurvefit(@myfunc,D0,t,c);f=myfunc(D,t);错误:Error using lsqcurvefit (line 247)Function value and YDATA sizes are incommensurate.是想通过非线性拟合求D.有t,c数据,方程是一个求和方程.
M文件:function f=myfunc(D,t)syms n t; x=1/n^2*exp((-1)*D*n^2*pi^2*t/0.0002^2);s=symsum(x,n,1,100);f=1-6/pi^2*s; end主程序:t=[180 420 780 1080 1380 1680 1920 2220 2520 2820 3120 3420 3720 4020 4380 4680 4980 5280];c=[0.08762 0.20444 0.36545 0.48247 0.59 0.67602 0.75 0.80407 0.86 0.9 0.94 0.96831 0.98561 0.99 0.99968 0.999999 1 1];D0=[0.001];D=lsqcurvefit(@myfunc,D0,t,c);f=myfunc(D,t);错误:Error using lsqcurvefit (line 247)Function value and YDATA sizes are incommensurate.是想通过非线性拟合求D.有t,c数据,方程是一个求和方程.
修改后的代码在附件里,可以直接运行该m文件.
再问: 为啥算出来的f全变成1了?f应该和c数据差不多啊
再问: 为啥算出来的f全变成1了?f应该和c数据差不多啊
Matlab Lsqucurvefit 函数 “Function value and YDATA sizes are n
matlab function
matlab:Error:Function definitions are not permitted in this
matlab 出现Function definitions are not permitted at the promp
matlab中set(head1,'xdata',x1,'ydata',y1)什么意思?
Find the maximal and minimal value of the function u = ln x
英语翻译OK --I opened it and there are dirrent boxes and sizes f
MATLAB function的问题- -
matlab创建function出错,
sizes are in mm是什么意思
There are many model cars in different s_ and sizes.(补全单词)
英语翻译Well I have all kinds and sizes of bananas.They are the