matlab switch怎么使用?1. 用switch结构实现下述函数表示. -1 x≤-a f(x)= x/a -a

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/16 05:38:38
matlabswitch怎么使用?1.用switch结构实现下述函数表示.-1x≤-af(x)=x/a-amatlabswitch怎么使用?1.用switch结构实现下述函数表示.-1x≤-af(x)

matlab switch怎么使用?1. 用switch结构实现下述函数表示. -1 x≤-a f(x)= x/a -a
matlab switch怎么使用?
1. 用switch结构实现下述函数表示.
-1 x≤-a
f(x)= x/a -a

matlab switch怎么使用?1. 用switch结构实现下述函数表示. -1 x≤-a f(x)= x/a -a
实际上用if-else语句更好.
swicth (x>=a)+(x>-a)
case 0
f=-1;
case 1
f=x/a;
case 2
f=-1;
end