error in .m file Line: 1 column: 1 invalid text character - line 1 all #

4 views (last 30 days)
Ive been having an issue running my .m file in Matlab (2021a). It keeps saying I have an invalid text character in line 1 column 1 but the entire line is #. Ive tried adding and removing # but nothing has worked. Please help if you can! Thanks!

Answers (1)

Voss on 8 Feb 2023
"#" is not used in any MATLAB statements or expressions, unless it's inside a string or character array.
Use "%" for comments.


Find more on Characters and Strings in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!