diff --git a/macro/MacroFlex.ll b/macro/MacroFlex.ll
index 9e3cbab852df53638a534c9249e05db169f5cbfc..d3aa240657c518b06fb65d95bb4501ee25fb37ef 100644
--- a/macro/MacroFlex.ll
+++ b/macro/MacroFlex.ll
@@ -83,6 +83,9 @@ EOL  (\r)?\n
                               BEGIN(INITIAL);
                             }
 
+ /* Double at-sign gives a single at-sign in output: useful for Matlab function-handles */
+<INITIAL>@@                 { *yyout << '@'; }
+
 <INITIAL>@                  { BEGIN(MACRO); }
 
 <MACRO>{SPC}+               { yylloc->step(); }