You can set a multi-line edit box by modifying the "max" uicontrol property of the edit box. If
MAX - MIN > 1
then editable text boxes accept multiline input. If
MAX - MIN <= 1
then editable text boxes accept only single line input.
You can change this parameter in two ways:
From GUIDE:
1) Double click on the edit box in question to bring up the Property Inspector.
2) Change the value of MAX to the desired number.
From the command line (or in a script):
1) Use the SET command with the following syntax:
where h_edit is the handle for the edit box and N is the desired number for MAX.
For more information on UICONTROL properties please take a look at the following documentation:
Please Note: The way the callback is executed is different for single and multiple lines. For more information on this, please see CALLBACK property from the above link.
You can evaluate the lines of text entered into the edit box in two ways. You can use the EVALMCW command (Evaluate Matlab Command Window) as follows:
where "h_edit" is the handle to the edit text box. The second method is to write your own FOR loop as follows:
s = get(h_edit,'string');
[row, column] = size(s);
for i = 1:row
eval(s{i,:})
end
0 Comments
Sign in to comment.