如何将这个特定方程转换为 matlab 代码

How to covert this specific equation to matlab code

如何将这个等式表示为 matlab 代码

像这样:

function y = sgn(x)
if x == 0
    y = 0;
else
    y = x / abs(x);
end
end