function e = f(x, y) e = x^2 + exp(-1/(y+1)); endfunction % f([2,3], [1,4]) gives and error, but arrayfun(@f, [2, 3], [1,4]) % works