How to allow for multiline input for inputdlg?
17 次查看(过去 30 天)
显示 更早的评论
Hello guys,
For my Octave program, I use a lot of inputdlg, but for all of them, the textbox is only one line long. Despite increasing the number of lines (num_lines) for each inputdlg, I am still only able to write one line of text amidst the textbox getting taller. The text does not move to the next line when I hit the right end of the textbox. Is there any way around this? Here's a snippet of my code below:
num_lines = 1;
cues = {'lake', 'river', 'water', 'ocean', 'forest'};
index1 = randi([1,5]);
answer = inputdlg(sprintf('Please detail any memory with the following word in mind: %s. Press enter when you are done.',cues{index1}),'Past Memory Exercise 1',num_lines);
0 个评论
回答(1 个)
Ive J
2021-6-27
Have you tried new line?
num_lines = 1;
cues = {'lake', 'river', 'water', 'ocean', 'forest'};
index1 = randi([1,5]);
answer = inputdlg(sprintf('Please detail any memory\nwith the following word in mind: %s.\nPress enter when you are done.',cues{index1}),'Past Memory Exercise 1',num_lines);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!