Writing S-Functions (The MathWorks Inc., 1998)