matlab画图出错R=5;r=2;c=5*exp(i*t);c1=3*exp(i*t)+2*exp(i*(-5*t/2+t)); c2=3*exp(i*t)+2*exp(i*(pi+5*t/2+t)); p=plot(real(c),imag(c));p1=plot( real(c1),imag(c1));p2=plot(real(c2),imag(c2));for t=linspace(0,4*pi,1000)set(p1,'xdata',real(c),'ydata',im
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 15:09:51
matlab画图出错R=5;r=2;c=5*exp(i*t);c1=3*exp(i*t)+2*exp(i*(-5*t/2+t)); c2=3*exp(i*t)+2*exp(i*(pi+5*t/2+t)); p=plot(real(c),imag(c));p1=plot( real(c1),imag(c1));p2=plot(real(c2),imag(c2));for t=linspace(0,4*pi,1000)set(p1,'xdata',real(c),'ydata',im
matlab画图出错
R=5;r=2;c=5*exp(i*t);c1=3*exp(i*t)+2*exp(i*(-5*t/2+t)); c2=3*exp(i*t)+2*exp(i*(pi+5*t/2+t)); p=plot(real(c),imag(c));p1=plot( real(c1),imag(c1));p2=plot(real(c2),imag(c2));for t=linspace(0,4*pi,1000)set(p1,'xdata',real(c),'ydata',imag(c));set(p2,'xdata',real(c1),'ydata',imag(c1));set(p3,'xdata',real(c2),'ydata',imag(c2));drawnow;end;
提示 Invalid handle object.,
matlab画图出错R=5;r=2;c=5*exp(i*t);c1=3*exp(i*t)+2*exp(i*(-5*t/2+t)); c2=3*exp(i*t)+2*exp(i*(pi+5*t/2+t)); p=plot(real(c),imag(c));p1=plot( real(c1),imag(c1));p2=plot(real(c2),imag(c2));for t=linspace(0,4*pi,1000)set(p1,'xdata',real(c),'ydata',im
程序中有几个错误:
(1)for循环应该写在计算c,c1,c2中,并按照向量存储
(2)其实画实部虚部只要plot(c)即可
程序在附件中
结果图如下: