What line ending does the MATLAB Editor use?

What line ending does the MATLAB Editor use?

 Accepted Answer

When creating files, MATLAB uses the default line ending of the operating system it is being run on. On Windows, the default line ending is carriage return and line feed (CRLF). On Mac and Linux, the default line ending is just line feed (LF).
When editing files, MATLAB continues to use the same line endings regardless of the operating system. For example, if a user creates an M-file on Windows (using CRLF) and then edits the file in Linux (default LF), MATLAB will continue to use CRLF.

1 Comment

Agreed...
It seems like Mathworks simply does not do much cross-platform development or interacts with GIT.
We're converting all our repos to utf-8 with LF right now to avoid huge conflicts in GIT. And we setup pre-commit hooks to ensure there are no CRLF left. And try to use proper .gitattributes...

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2017b

Community Treasure Hunt

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

Start Hunting!