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

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/19 16:59:53
matlab switch怎么使用?1. 用switch结构实现下述函数表示.             -1   x≤-a   f(x)=   x/a  -a
x)M,ILR(.,IxdgǓOYao wO~6y6

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