Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word wrap in MATLAB editor

How can I word-wrap long lines of scripts and functions in the MATLAB R2011b Editor?

I don't mean using Ctrl+J to wrap comments, but show a long line over several lines, each (except the last) the width of the editor frame, as in most text editors, so I don't need to scroll horizontally; the effect is purely visual and it remains as a single line in the file.

I could not find a setting in any menu, toolbar or the preferences dialog.

Though I could split the line into multiple lines using "...", I don't want to do this. I want to keep it as one line in the file, just show it wrapped, as in Format > Word Wrap in Windows Notepad.

like image 940
Gnubie Avatar asked May 01 '12 16:05

Gnubie


2 Answers

The way to do this is by using the three dots ... For example:

Hc_frame_1 = uicontrol(gcf, ...
'Style', 'frame',...
'Units', 'pixels',...
'Position', [25 250 200 230]);

These three dots tell MATLAB to continue the command on the next line. Without them MATLAB will think that the command is incomplete.

like image 115
copiancestral Avatar answered Nov 08 '22 17:11

copiancestral


There is no way to wrap general text in the editor.

It can be set to do so but just for comments.

like image 1
cladelpino Avatar answered Nov 08 '22 19:11

cladelpino