diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc
index 58311c0e0a4af2e2bf3ff5e1bce92671483a09d4..ba7bf5e63953187cbf2c977ad933c2ce4b46c066 100644
--- a/preprocessor/ParsingDriver.cc
+++ b/preprocessor/ParsingDriver.cc
@@ -342,6 +342,9 @@ ParsingDriver::add_expression_variable(string *name)
       || mod_file->symbol_table.getType(*name) == eLogTrend)
     error("Variable " + *name + " not allowed outside model declaration, because it is a trend variable.");
 
+  if (mod_file->symbol_table.getType(*name) == eExternalFunction)
+    error("Symbol '" + *name + "' is the name of a MATLAB/Octave function, and cannot be used as a variable.");
+
   int symb_id = mod_file->symbol_table.getID(*name);
   expr_t id = data_tree->AddVariable(symb_id);