Gnubie
Gnubie

Reputation: 2607

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.

Upvotes: 10

Views: 14927

Answers (2)

cladelpino
cladelpino

Reputation: 338

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

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

Upvotes: 1

copiancestral
copiancestral

Reputation: 122

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.

Upvotes: 2

Related Questions