The function linewrap.m wraps a single string into multiple lines by breaking it at word boundaries. The user can specify the desired maximum number of characters per line.
Cite As
Steve Eddins (2026). Line-wrap a string (https://www.mathworks.com/matlabcentral/fileexchange/9909-line-wrap-a-string), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R14SP3
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: EnergyPlus Co-simulation Toolbox, Create and Output Montage of Images, SeisLab 3.01
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
