What line ending does the MATLAB Editor use?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 1월 17일

0 개 추천

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

Jan Kappen
Jan Kappen 2020년 7월 29일
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...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by