MATLAB Error using ==> plot Vectors must be the same lengths.

来源:百度知道 编辑:UC知道 时间:2024/05/05 23:48:38
text(-5,2,'y=(2*x+1)/(x-3)');
hold on;
x1=-20:0.1:-3;
y1=(2*x+1)./(x-3);
x2=-3:0.01:1;
y2=(2*x+1)./(x-3);
x3=1:0.001:5;
y3=(2*x+1)./(x-3);
x4=5:0.01:9;
y4=(2*x+1)./(x-3);
x5=9:0.1:20;
y5=(2*x+1)./(x-3);
x=[x1,x2,x3,x4,x5];
y=[y1,y2,y3,y4,y5];
plot(x,y);
axis([-20 20 -1000 1000])
请问要如何修改?

晕,我受不了了。。你那x是哪儿来的?摆明了是x1,x2,x3,x4,x5...

o(∩_∩)o 你好搞哦~~~~建议你还是学一学基础语法再做这东西吧,另外矩阵不掌握也是学不好的