查看单个帖子
旧 2008-10-12, 15:38   #1
docxin
初级会员
 
docxin 的头像
 
注册日期: 2008-08-30
年龄: 44
帖子: 10
声望力: 17
docxin 正向着好的方向发展
默认 [求助]分段函数的Matlab表示?

对于分段函数
f(x)=2*x/L (0<x<L/2)
=2*(L-x)/L (L/2<x<L) L=pi
如何用matlab表示:
>> syms x L
>> f=(2*x/L)*(0<x<L/2)+2*(L-x)/L*(L/2<x<L)
提示:
??? Error using ==> <
Function '<' is not defined for values of class 'sym'.
"<"在类sym中没有定义值,应该怎么写才正确?谢谢!!!
docxin 当前离线   回复时引用此帖