Input Dialogue box text not breaking line
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
Hello,
In the code below, I am attempting to break the lines of text in the dialogue box to two lines: line 1: What Text or Word would you like me to write? line 2: [No spaces allowed for first input]
This is what I get

Can you help me break the lines properly? Thanks
   % Ask user for input word
  Input = inputdlg(['What Text or Word would you like me to write?',...
                    '\n[No spaces allowed for first input]'],... 
               'Sample', [1 50]);
댓글 수: 0
채택된 답변
  Star Strider
      
      
 2017년 11월 16일
        The sprintf function does this the way you want:
Input = inputdlg(sprintf('%s\n%s', 'What Text or Word would you like me to write?',...
    '[No spaces allowed for first input]'),...
    'Sample', [1 50]);
(Using inputdlg is definitely the way to go!)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

