MATLAB Answers


GUI Creation

Asked by Zach
on 13 May 2011
Hey I'm creating a GUI for a new engineering course. The GUI is for a project that gets agents to go around in a circle. Ultimately I want to have a text box so that the students can write their code in the text box, but it seems like the text box only allows a single line of writing. Anyway that I would be able to have a space for them to insert their code in?
Thanks in advance!

  1 Comment

Sean de Wolski
on 13 May 2011
I think you're winning this week's effective question asking contest.

Sign in to comment.


2 Answers

Answer by Andy
on 13 May 2011
 Accepted Answer

Editable text – The Value property does not apply. If Max - Min > 1, then editable text boxes accept multiline input.

  1 Comment

Paulo Silva
on 13 May 2011
+1 vote

Sign in to comment.

Answer by Arturo Moncada-Torres on 13 May 2011

You can use an "Input Dialog Box" with the function inputdlg.
For example, suppose you want a dialog box with two questions and three lines for each answer:
noLines = 3;
answers = inputdlg({'Question 1','Question 2'},...
'Title of the Dialog Box', noLines,...
{'Default Answer 1', 'Default Answer 2'});
Remember that answers is a cell array where each element corresponds to each answer (answer{1} has the answer of Question 1 and so on).
Hope this helps ;-)


Sign in to comment.