??? Error using ==> plot
Conversion to double from sym is not possible.
Error in ==> maichong2 at 39
plot(k,G)
顺便问下怎么画出带虚部的函数图
??? Error using ==> plot
Conversion to double from sym is not possible.
Error in ==> maichong2 at 39
plot(k,G)
顺便问下怎么画出带虚部的函数图
clc
clear all
A1=6;A2=-6;A4=12;s=0.8;w0=12;w=15;t1=0.15;U0=120;t2=0.3;t3=3;
U=U0*pi/180;j=sqrt(-1);
T1=linspace(0,t1,100);
u=U*T1/t1;
Rt1=A1+A2*(exp(-s*w0.*T1)).*cos(w.*T1)+A4*sin(w.*T1).*(exp(-s*w0.*T1));
r01=A1+A2*(exp(-s*w0.*t1)).*cos(w.*t1)+A4*sin(w.*t1).*(exp(-s*w0.*t1));
gun1=int('A1*exp(-j*k*T1)+A2*(exp(-s*w0*T1-j*k*T1))*cos(w*T1)+A4*sin(w*T1)*(exp(-s*w0*T1-j*k*T1))','T1');
gum1=int('exp(-j*k*T1)*U*T1/t1','T1');
G1=gun1/gum1;
T2=linspace(t1,t2,100);
u=(U*T2-U*t2)/(t1-t2);
Rt2=r01-(A1+A2*(exp(-s*w0.*(T2-t1))).*cos(w.*(T2-t1))+A4*sin(w.*(T2-t1)).*(exp(-s*w0.*(T2-t1))));
gun2=int('r01*exp(-j*k*T2)-(A1*exp(-j*k*T2)+A2*(exp(-s*w0*T2-j*k*T2))*cos(w*T2)+A4*sin(w*T2)*(exp(-s*w0*T2-j*k*T2)))','T2');
gu=int('exp(-j*k*t)*(U*T2-U*t2)/(t1-t2)','T2')+int('exp(-j*k*t)*U*T1/t1','T1',0,t1)-int('exp(-j*k*t)*(U*T2-U*t2)/(t1-t2)','T2',0,t1);
G2=gun2/gu;
T3=linspace(t2,t3,300);
u=0;
Rt3=r01-(A1+A2*(exp(-s*w0.*(T3-t1))).*cos(w.*(T3-t1))+A4*sin(w.*(T3-t1)).*(exp(-s*w0.*(T3-t1))));
gun3=int('r01*exp(-j*k*T3)-(A1*exp(-j*k*T3)+A2*(exp(-s*w0*T2-j*k*T3))*cos(w*T3)+A4*sin(w*T3)*(exp(-s*w0*T3-j*k*T3)))','T3');
gum3=int('exp(-j*k*t)*U*T1/t1','T1',0,t1)+int('exp(-j*k*t)*(U*T2-U*t2)/(t1-t2)','T2',t1,t2);
G3=gun3/gum3;
G=[G1 G2 G3];
r=[Rt1 Rt2 Rt3];
t=[T1 T2 T3];
figure(2)
plot(t,r)
title('转向盘角脉冲输入的横摆角速度曲线')
k=linspace(0,3);
figure(3)
plot(k,G)
错误是
??? Error using ==> plot
Conversion to double from sym is not possible.
Error in ==> maichong2 at 39
plot(k,G)