马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
改变一个参数Tn的名字就导致Error:@@ ,是不是我的Matlab坏了?
function test4
Tn=1.5;
a=0.7;
m=dsolve('Dm=a*x+Tn','m(0)=-2','x')
m=subs(m)
结果都正常,test4回车
m =
1/2*a*x^2+Tn*x-2
m =
7/20*x^2+3/2*x-2, 但是把“Tn”改成“T_n”就出错了,
function test4
T_n=1.5;
a=0.7;
m=dsolve('Dm=a*x+T_n','m(0)=-2','x')
m=subs(m)
test4回车
m =
1/2*a*x^2+Tn*x-2
??? Undefined function or variable 'a'.
Error in ==> D:\Matlab\toolbox\symbolic\@sym\subs.m
On line 89 ==> NEWexpr{k} = evalin('base',char(VaR{j(k)}));
Error in ==> D:\Matlab\work\test4.m
On line 5 ==> m=subs(m)
我再改!!!把“T_n”改成“Tm”,错误又不一样了?
function test4
Tm=1.5;
a=0.7;
m=dsolve('Dm=a*x+Tm','m(0)=-2','x')
m=subs(m)
test4回车
??? Error using ==> dsolve
Error, (in dsolve/IC) The 'implicit' option is not available when giving Initial Conditions.
Error in ==> D:\Matlab\work\test4.m
On line 4 ==> m=dsolve('Dm=a*x+Tm','m(0)=-2','x')
折腾了半天也不明白,这到底是怎么一回事???Matlab坏了吗:@o |