matlab运行老是报错.syms L I Rs Rr a Rg Z x yZ=(Rg*(Rs+Rr))^(0.5)a=((Rs+Rr)/Rg)^(0.5)I=1000L=2Rg=15Rs=0.026Rr=0.0001x=0:0.1:2y=-I*Z*Rs*tanh(a*L/2)*cosh(a*x)/(Rs+Rr)+I*Z*Rs*sinh(a*x)/(Rs+Rr)plot(x,y)grid on报错为:Error using ==> plotConversi
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 09:07:50
matlab运行老是报错.syms L I Rs Rr a Rg Z x yZ=(Rg*(Rs+Rr))^(0.5)a=((Rs+Rr)/Rg)^(0.5)I=1000L=2Rg=15Rs=0.026Rr=0.0001x=0:0.1:2y=-I*Z*Rs*tanh(a*L/2)*cosh(a*x)/(Rs+Rr)+I*Z*Rs*sinh(a*x)/(Rs+Rr)plot(x,y)grid on报错为:Error using ==> plotConversi
matlab运行老是报错.
syms L I Rs Rr a Rg Z x y
Z=(Rg*(Rs+Rr))^(0.5)
a=((Rs+Rr)/Rg)^(0.5)
I=1000
L=2
Rg=15
Rs=0.026
Rr=0.0001
x=0:0.1:2
y=-I*Z*Rs*tanh(a*L/2)*cosh(a*x)/(Rs+Rr)+I*Z*Rs*sinh(a*x)/(Rs+Rr)
plot(x,y)
grid on
报错为:
Error using ==> plot
Conversion to double from sym is not possible.
Error in ==> Untitled at 11
plot(x,y)
matlab运行老是报错.syms L I Rs Rr a Rg Z x yZ=(Rg*(Rs+Rr))^(0.5)a=((Rs+Rr)/Rg)^(0.5)I=1000L=2Rg=15Rs=0.026Rr=0.0001x=0:0.1:2y=-I*Z*Rs*tanh(a*L/2)*cosh(a*x)/(Rs+Rr)+I*Z*Rs*sinh(a*x)/(Rs+Rr)plot(x,y)grid on报错为:Error using ==> plotConversi
1.你的程序里是按照符号运算的.符号运算不用plot,好像用要用ezplot的.
2.我不知道你程序里的物理概念,但改一下就行:
%syms L I Rs Rr a Rg Z x y
I=1000
L=2
Rg=15
Rs=0.026
Rr=0.0001
Z=(Rg*(Rs+Rr))^(0.5)
a=((Rs+Rr)/Rg)^(0.5)
x=0:0.1:2
y=-I*Z*Rs*tanh(a*L/2)*cosh(a*x)/(Rs+Rr)+I*Z*Rs*sinh(a*x)/(Rs+Rr)
plot(x,y)
grid on