matlab求助,nlinfit求助.clc;clearx=[0.48,0.42,0.36,0.3,0.25,0.2,0.14,0.08,0.02;5000,5000,5000,5000,5000,5000,5000,5000,5000]'y=[6.73333E-05,5.13333E-05,4.46667E-05,3.83333E-05,2.93333E-05,0.000022,1.73333E-05,0.000003,-1.66667E-06]'t2=25B=120L=500

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 21:30:44

matlab求助,nlinfit求助.clc;clearx=[0.48,0.42,0.36,0.3,0.25,0.2,0.14,0.08,0.02;5000,5000,5000,5000,5000,5000,5000,5000,5000]'y=[6.73333E-05,5.13333E-05,4.46667E-05,3.83333E-05,2.93333E-05,0.000022,1.73333E-05,0.000003,-1.66667E-06]'t2=25B=120L=500
matlab求助,nlinfit求助.
clc;clear
x=[0.48,0.42,0.36,0.3,0.25,0.2,0.14,0.08,0.02;5000,5000,5000,5000,5000,5000,5000,5000,5000]'
y=[6.73333E-05,5.13333E-05,4.46667E-05,3.83333E-05,2.93333E-05,0.000022,1.73333E-05,0.000003,-1.66667E-06]'
t2=25
B=120
L=500
f=@(b,x)(x(:,2)./(2*t2*B)-b(2)*x(:,2)/b(1)+b(2)*x(:,2)*exp(-sqrt(b(1))*L)/b(1))./(exp(sqrt(b(1))*L)-exp(-sqrt(b(1))*L))*exp(sqrt(b(1))*x(:,1))+(x(:,2)/(2*t2*B)-b(2)*x(:,2)/b(1)+b(2)*x(:,2)*exp(sqrt(b(1))*L)/b(1))./(exp(-sqrt(b(1))*L)-exp(sqrt(b(1))*L))*exp(-sqrt(b(1))*x(:,1))+b(2)*x(:,2)/b(1)
b0=[1;1]
betafit=nlinfit(x,y,f,b0)
运行时提示错误.
Error using ==> nlinfit
The model function '@(b,x)(x(:,2)/(2*t2*B)-b(2)*x(:,2)/b(1)+b(2)*x(:,2)*exp(-sqrt(b(1))*L)/b(1))./(exp(sqrt(b(1))*L)-exp(-sqrt(b(1))*L))*exp(sqrt(b(1))*x(:,1))+(x(:,2)/(2*t2*B)-b(2)*x(:,2)/b(1)+b(2)*x(:,2)*exp(sqrt(b(1))*L)/b(1))./(exp(-sqrt(b(1))*L)-exp(sqrt(b(1))*L))*exp(-sqrt(b(1))*x(:,1))+b(2)*x(:,2)/b(1)' generated the following error:
Error using ==> mtimes
Inner matrix dimensions must agree.
不知道哪里错了.
拟合函数如下:
C1=(x(:,2)./(2*t2*B)-b(2)*x(:,2)./b(1)+b(2)*x(:,2)*exp(-sqrt(b(1))*L)./b(1))./(exp(sqrt(b(1))*L)-exp(-sqrt(b(1))*L))
C2=(x(:,2)./(2*t2*B)-b(2)*x(:,2)./b(1)+b(2)*x(:,2)*exp(sqrt(b(1))*L)./b(1))./(exp(-sqrt(b(1))*L)-exp(sqrt(b(1))*L))
f=C1*exp(sqrt(b(1))*x(:,1))+C2*exp(-sqrt(b(1))*x(:,1))+b(2)*x(:,2)./b(1)
希望求解方程中的两个参数,b(1)与b(2).

matlab求助,nlinfit求助.clc;clearx=[0.48,0.42,0.36,0.3,0.25,0.2,0.14,0.08,0.02;5000,5000,5000,5000,5000,5000,5000,5000,5000]'y=[6.73333E-05,5.13333E-05,4.46667E-05,3.83333E-05,2.93333E-05,0.000022,1.73333E-05,0.000003,-1.66667E-06]'t2=25B=120L=500
错误信息是矩阵大小不统一 你仔细看看你的各个参数的大小size是否一致

Matlab求助 求助matlab中nlinfit问题.紧急.function yhat=modelfun(beta,x)yhat=beta(1)*exp(beta(2)./x);x=2:16;y=[6.42 8.20 9.58 9.5 9.7 10 9.93 9.99 10.49 10.59 10.60 10.80 10.60 10.90 10.76];beta0=[8 2]';betafit=nlinfit(X,y',@modelfun,beta0);结果出现 求助matlab中nlinfit问题f=inline('((a(1)-a(4))./(1+(x/a(3).).^a(2)))+a( 4)','a','x');x=0.5:0.1:1.5y=[0,0,0.006,0.175,1.05,1.7,1.85,1.9,1.95,1.975,2]a0=[0,2,1,3]b=nlinfit(x,y,f,a0)plot(x,y,' o',x,f(b,x),'-')有错误Error using nlinfit (line 114 matlab求助,nlinfit求助.clc;clearx=[0.48,0.42,0.36,0.3,0.25,0.2,0.14,0.08,0.02;5000,5000,5000,5000,5000,5000,5000,5000,5000]'y=[6.73333E-05,5.13333E-05,4.46667E-05,3.83333E-05,2.93333E-05,0.000022,1.73333E-05,0.000003,-1.66667E-06]'t2=25B=120L=500 求助 :leslie 数学建模程序 (MATLAB) 求助正则化算法的Matlab程序 拜求助画样条基函数的matlab函数 求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2我的程序:b1,b2,x0,d 为四个待拟合参数y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2 求助求助,初中数学题 【求助】如何采用Matlab绘制电子云密度图 求助matlab种幂函数回归 这样的:求abc 【求助】matlab如何求解sinc函数的反函数 【求助】matlab如何求解sinc函数的反函数 求助!matlab如何产生双对角矩阵如下所示 求助Matlab中求解特征根的函数 matlab nlinfit函数基于什么迭代算法写的 求助求助求助 怎么查电费 求一个matlab带参数的积分,其中c为一个常数,由于用int积不出来相应的表达式,所以打算用数值积分算该式算出来的要是c的表达式.求助啊,本人初用matlab,求助求助