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.
Steve Eddins (2020). Line-wrap a string (https://www.mathworks.com/matlabcentral/fileexchange/9909-line-wrap-a-string), MATLAB Central File Exchange. Retrieved .
Very very good! Nice job!
Very useful, thanks for sharing
for users: a great little helper that wraps your endless line into a nice little parcel (command line output/uicontrols)...
for programmers: look at the remarkable regular expression...
nice exercise with regular expressions, it will get a 5/5 if it handles multiple white-spaces more consistently, eg, with a final DEBLANK(?)
moreover, a pointer to TEXTWRAP, which implements an only slightly different engine, would be nice
Update keywords and description to make it easier to find this file via search.
Implemented suggestions from Urs: Use strtrim on the input string to remove leading and trailing whitespace; use deblank on output array to remove trailing whitespace; add cross-reference to textwrap.