x=-6:1:6
leng=length(x)
for i=1:leng
if x(i)<=3
y(i)=x(i);
else
y(i)=-x(i)+6;
end
end
plot(x,y,'-'),grid;
怎么报错说Vectors must be the same lengths.
新手谢谢帮忙
[img]file:///C:\Users\windy\AppData\Roaming\Tencent\Users\981023864\QQ\WinTemp\RichOle\3O$O6RLI{I)1@LSORK978[Q.jpg[/img]