matlab高手求教!Error using plot Conversion to double from sym is not possible.clc;clear;syms Ao=500.000;r = 0.1000;k = 0.1000;e = 10.000;w = 1/2.* sqrt(A.^2 + 4 .*e.^2);c = 1/2 + A./(4 .*w);s = 1/2 - A./(4 .*w); g1 = sqrt(o.* k .*r) ;g = g1 .*c;
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 16:32:38
matlab高手求教!Error using plot Conversion to double from sym is not possible.clc;clear;syms Ao=500.000;r = 0.1000;k = 0.1000;e = 10.000;w = 1/2.* sqrt(A.^2 + 4 .*e.^2);c = 1/2 + A./(4 .*w);s = 1/2 - A./(4 .*w); g1 = sqrt(o.* k .*r) ;g = g1 .*c;
matlab高手求教!Error using plot Conversion to double from sym is not possible.
clc;
clear;
syms A
o=500.000;
r = 0.1000;
k = 0.1000;
e = 10.000;
w = 1/2.* sqrt(A.^2 + 4 .*e.^2);
c = 1/2 + A./(4 .*w);
s = 1/2 - A./(4 .*w);
g1 = sqrt(o.* k .*r) ;
g = g1 .*c;
r1 = r .*s.^2;
r2 = r .*c.^2;
r3 = r./2 .*(1 + 2 .*s .* c);
a = (2.* g.^2 .*r1 - 2.* g.^2.* r2 - k .*r1.* r3 - k.* r2.* r3)/(4 .*g.^2.* k) ;
q = ((16.* a.^2.* g.^2 .* r1.* (r1 - r2).* (r1 + r2).* r3.^2)./(4.*a.* g.^2 + (r1 + r2) .*r3) - (4 .*a.^2.* g.^2 .*(r1 - r2) .*(r1 + r2).^2.* r3.^2)./(4 .*a .*g.^2 + (r1 + r2).* r3) - (32 .*a.^2.* g.^2 .*r2 .*r3.^2 .*(2.* a.* g.^2 + r1 .*r3))./(4 .*a .*g.^2 + (r1 + r2) .*r3) - 2 .*a.*(r1 + r2).^2 .*r3.^2 .*(r1 + (r3 .*(2.* a.* g.^2 + r1 .*r3))./(4 .*a.* g.^2 + (r1 + r2).* r3))).* g.^2./( r3 .*(4.* a.* g.^2 + (r1 + r2) .*r3)).*1./(abs(-k - (8.* g.^4 .*a .*(r1 - r2))./(4.* g.^2 .*a + (r1 + r2).* r3)^2 + (2.* g.^2 .*(r1 - r2))./(4.* g.^2.* a + (r1 + r2) .*r3)) .* a .* 2);
A=-100:0.001:100;
plot(A,q)
想画个图 可是一直出不来 好苦闷啊
matlab高手求教!Error using plot Conversion to double from sym is not possible.clc;clear;syms Ao=500.000;r = 0.1000;k = 0.1000;e = 10.000;w = 1/2.* sqrt(A.^2 + 4 .*e.^2);c = 1/2 + A./(4 .*w);s = 1/2 - A./(4 .*w); g1 = sqrt(o.* k .*r) ;g = g1 .*c;
A=-100:0.001:100;
o=500.000;
r = 0.1000;
k = 0.1000;
e = 10.000;
w = 1/2.* sqrt(A.^2 + 4 .*e.^2);
c = 1/2 + A./(4 .*w);
s = 1/2 - A./(4 .*w);
g1 = sqrt(o.* k .*r) ;
g = g1 .*c;
r1 = r .*s.^2;
r2 = r .*c.^2;
r3 = r./2 .*(1 + 2 .*s .* c);
a = (2.* g.^2 .*r1 - 2.* g.^2.* r2 - k .*r1.* r3 - k.* r2.* r3)/(4 .*g.^2.* k) ;
q = ((16.* a.^2.* g.^2 .* r1.* (r1 - r2).* (r1 + r2).* r3.^2)./(4.*a.* g.^2 + (r1 + r2) .*r3) - (4 .*a.^2.* g.^2 .*(r1 - r2) .*(r1 + r2).^2.* r3.^2)./(4 .*a .*g.^2 + (r1 + r2).* r3) - (32 .*a.^2.* g.^2 .*r2 .*r3.^2 .*(2.* a.* g.^2 + r1 .*r3))./(4 .*a .*g.^2 + (r1 + r2) .*r3) - 2 .*a.*(r1 + r2).^2 .*r3.^2 .*(r1 + (r3 .*(2.* a.* g.^2 + r1 .*r3))./(4 .*a.* g.^2 + (r1 + r2).* r3))).* g.^2./( r3 .*(4.* a.* g.^2 + (r1 + r2) .*r3)).*1./(abs(-k - (8.* g.^4 .*a .*(r1 - r2))./(4.* g.^2 .*a + (r1 + r2).* r3).^2 + (2.* g.^2 .*(r1 - r2))./(4.* g.^2.* a + (r1 + r2) .*r3)) .* a .* 2);
plot(A,q)
不需要用到符号变量,直接用数值就可以了
注意你源程序中q=.这行,有一个^忘了用.^,也帮你改了