How can I reformat code in MATLAB editor?

后端 未结 2 1440
粉色の甜心
粉色の甜心 2020-12-05 08:31

How can I reformat code in MATLAB editor? Other IDEs usually have reformat or format option that arrange position of written codes. Does editor of MATLAB have it? I use MATL

2条回答
  •  离开以前
    2020-12-05 09:07

    I have created a minimalist, configurable MATLAB source code formatter, which can be used directly in the MATLABEditor.

    You can find it on GitHub: MBeautifier on GitHub

    Main features:

    • Padding operators and keywords with white spaces
    • Configurable indentation character and level. Indentation using the Smart Indent functionality of the MATLAB Editor
    • Removal/addition of continuous empty lines
    • Inserting missing element separators (commas) in matrix and cell array initializations
    • Insert missing continuous symbol line in matrix and cell array initializations
    • In-lining continuous lines
    • Formats the current page of the MATLAB Editor or only a selection in the MATLAB Editor or file(s)
    • While everything above is configurable in a single XML file

    It can be used in Matlab versions starting from R2013b.

    Deployment and configuration are described on GitHub (link above).

提交回复
热议问题