diff --git a/Lib/matlab/matlabuserdir.swg b/Lib/matlab/matlabuserdir.swg index ebb11b3a584..7bc4a9a5ee5 100644 --- a/Lib/matlab/matlabuserdir.swg +++ b/Lib/matlab/matlabuserdir.swg @@ -2,6 +2,11 @@ * Special user directives * ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +/* Inserting MATLAB code */ +#define %matlabcode %insert("matlab") + /* ------------------------------------------------------------------------- */ /* Implicit Conversion using the C++ constructor mechanism diff --git a/Source/Modules/matlab.cxx b/Source/Modules/matlab.cxx index e93b81443f2..cfb2ae5e09c 100644 --- a/Source/Modules/matlab.cxx +++ b/Source/Modules/matlab.cxx @@ -2609,7 +2609,9 @@ int MATLAB::insertDirective(Node *n) { String *code = Getattr(n, "code"); String *section = Getattr(n, "section"); - if (Cmp(section, "matlabsetup") == 0) { + if (Cmp(section, "matlab") == 0) { + Printv(f_wrap_m, code, NIL); + } else if (Cmp(section, "matlabsetup") == 0) { Printv(f_setup_m, code, NIL); } else { Language::insertDirective(n);