My problem was that my drawMyMask.m file looked like this:
function drawMyMask
image(imread('pic.jpg'))
port_label('input', 1, 'my_input')
The thing throwing it off was the first line -- it needed to be a straight script, not a function. Delete the "function" line, and all works.
