新手使用matlab出现Error using ==> plot Vectors must be the same lengths.subplot(3,1,1)x1=-pi:pi/50:pi;y1=x.*cos(x);plot(x1,y1,'m.')grid on,title('y=xcosx'),xlabel('x轴'),ylabel('y轴')gtext('y=xcosx'),legend('y=xcosx')subplot(3,1,2)x2=pi:pi/50
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/02 16:52:26
![新手使用matlab出现Error using ==> plot Vectors must be the same lengths.subplot(3,1,1)x1=-pi:pi/50:pi;y1=x.*cos(x);plot(x1,y1,'m.')grid on,title('y=xcosx'),xlabel('x轴'),ylabel('y轴')gtext('y=xcosx'),legend('y=xcosx')subplot(3,1,2)x2=pi:pi/50](/uploads/image/z/11508673-49-3.jpg?t=%E6%96%B0%E6%89%8B%E4%BD%BF%E7%94%A8matlab%E5%87%BA%E7%8E%B0Error+using+%3D%3D%3E+plot+Vectors+must+be+the+same+lengths.subplot%283%2C1%2C1%29x1%3D-pi%3Api%2F50%3Api%3By1%3Dx.%2Acos%28x%29%3Bplot%28x1%2Cy1%2C%27m.%27%29grid+on%2Ctitle%28%27y%3Dxcosx%27%29%2Cxlabel%28%27x%E8%BD%B4%27%29%2Cylabel%28%27y%E8%BD%B4%27%29gtext%28%27y%3Dxcosx%27%29%2Clegend%28%27y%3Dxcosx%27%29subplot%283%2C1%2C2%29x2%3Dpi%3Api%2F50)
新手使用matlab出现Error using ==> plot Vectors must be the same lengths.subplot(3,1,1)x1=-pi:pi/50:pi;y1=x.*cos(x);plot(x1,y1,'m.')grid on,title('y=xcosx'),xlabel('x轴'),ylabel('y轴')gtext('y=xcosx'),legend('y=xcosx')subplot(3,1,2)x2=pi:pi/50
新手使用matlab出现Error using ==> plot Vectors must be the same lengths.
subplot(3,1,1)
x1=-pi:pi/50:pi;
y1=x.*cos(x);
plot(x1,y1,'m.')
grid on,
title('y=xcosx'),xlabel('x轴'),ylabel('y轴')
gtext('y=xcosx'),legend('y=xcosx')
subplot(3,1,2)
x2=pi:pi/50:4*pi;
y2=x.*tan(1./x).*sin(x^3);
plot(x2,y2,'g*'),grid on,
title('y=xtan(1/x)sinx^3'),xlabel('x轴'),ylabel('y轴')
gtext('y=xtan(1/x)sinx^3'),legend('y=xtan(1/x)sinx^3')
subplot(3,1,3)
x3=1:1/50:8;
y3=exp(1./x).*sin(x);
plot(x3,y3,'rd'),grid on,
title('e^(1/3)sinx'),xlabel('x轴'),ylabel('y轴')
gtext('e^(1/3)sinx'),legend('e^(1/3)sinx')
新手使用matlab出现Error using ==> plot Vectors must be the same lengths.subplot(3,1,1)x1=-pi:pi/50:pi;y1=x.*cos(x);plot(x1,y1,'m.')grid on,title('y=xcosx'),xlabel('x轴'),ylabel('y轴')gtext('y=xcosx'),legend('y=xcosx')subplot(3,1,2)x2=pi:pi/50
subplot(3,1,2)
x2=pi:pi/50:4*pi;
y2=x.*tan(1./x).*sin(x^3); 改为y2=x.*tan(1./x).*sin(x.^3)