Align comments

Align comments in file, or all files in folder (and optionally their subfolders)

Al momento, stai seguendo questo contributo

Align comments in file, or all files in folder (and optionally their subfolders)
Before
After
Installation
Copy to MATLAB path ("C:\Users\{USERNAME}\Documents\MATLAB") to allow usage everywhere.
Usage
To format all files in active directory, just run "alignComments" in the terminal.
To format a specific file (or all files in a specific folder), "alignComments("FILE_OR_FOLDER_FULL_OR_RELATIVE_PATH")"
To format a specific set of files (or all files in specific folders), "alignComments({"FILES_OR_FOLDERS_FULL_OR_RELATIVE_PATH"})"
To format files without overwriting (output file will be created with the suffix "_new"), "alignComments({OPTIONAL_FILE_OR_FOLDER},'overwrite',0)"
To format files in subfolders as well, enable recursion by "alignComments({OPTIONAL_FILE_OR_FOLDER},'recursive',0)"
NOTE
While no trouble has been reported with the script, the author cannot guarantee that this script won't break your m files, so you are encouraged to use it first without overwriting, just in case the script parses the m file incorrectly and messes it up. In that case, the author suggests you reach out, so bugs/shortcomings can be addressed.

Cita come

Tanmay Chhatbar (2026). Align comments (https://it.mathworks.com/matlabcentral/fileexchange/129514-align-comments), MATLAB Central File Exchange. Recuperato .

Add the first tag.

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con R2021b e release successive

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0

Now considers transposes, character arrays and string arrays smartly

0.972

No functional changes
Updated File Exchange image again

0.971

No functional changes
Updated File Exchange image

0.97

No functional changes
Better formatting
README update

0.96

Fixed a bug that incorrectly parsed inputs when given as a cell array

0.94

Suppress some output on terminal in some cases

0.93

Better help

0.92

Bugfix for 0.91

0.91

Improved detection of spaces, and alignment with the default comment line within MATLAB

0.90

Updated description

0.9