fork download
  1. f=@(x)[x(all(t=x<=x')) x(sum(t)==1)]
  2.  
  3. f([0, 15, 2, 3, 7, 18, -2, 9, 6, -5, 3, 8, 9, -14])
  4. f(5)
Success #stdin #stdout 0.22s 121792KB
stdin
Standard input is empty
stdout
f =

@(x) [x(all (t = x <= x')), x(sum (t) == 1)]

ans =

  -14   18

ans =

   5   5