Invalid input character

I’m a brand new Dynare user, and have what is probably a pretty basic problem, but I searched the forum and didn’t find an answer. When I run dynare on my simple program (invmod1.mod), some unrecognizable characters show up in the .mod file (just before the initval section), and I get the message below in Matlab. I can see the characters if I edit the .m file in Matlab, but I don’t know how they get there. Any ideas? Thanks.

Starting MATLAB/Octave computing.

??? Error: File: invmod1.m Line: 140 Column: 1
The input character is not valid in MATLAB statements or expressions.

Error in ==> dynare at 132
evalin(‘base’,fname) ;
invmod1.m (5.38 KB)
invmod1.mod (909 Bytes)

Directly before the model and the initval statements are some invisible control characters in the empty line. Delete them and the file runs. Probably your text-editor did not set a correct line carriage.

Thanks, I figured it had to be something like that, but I tried a bunch of different editors and none of them picked up the characters.

We recommend to either use the built-in editor shipped with MATLAB (you can invoke it using the “edit” command), or to use a good text editor such as Emacs (available under Windows, Mac and Linux).