Pages

Friday, February 5, 2010

matlab 分段函数

x=[-3:0.1:4];
y=(x+2).*(x<0)+(-x+3).*(x>=0);
plot(x,y)

1 comments:

RUBY said...

分段函数我好像学过的。。。。