例如,
x = linspace (1, 1, 1000);
情节(x, twoparts (x))
函数y = twoparts (x)
y = abs (x);
地区= x > 0;
y(地区)= x(地区)^ 2;
结束