Found a potential bug in 'listdlg'?

조회 수: 6 (최근 30일)
Ziv Kassner
Ziv Kassner 2020년 3월 27일
댓글: Ziv Kassner 2020년 3월 28일
When typing the following code:
[w,~] = listdlg('PromptString',{strcat(['Select a wing for ' ,...
'individual number ',num2str(indx)])},...
'SelectionMode','single','ListString',fn);
It doesn't show the words after 'individual'
I wonder why...
Thanks,
Ziv

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 3월 28일
편집: Cris LaPierre 2020년 3월 28일
It wouldn't be a bug since this behavior is documented in the doc.
"If you specify the prompt as a character vector that is longer than the width of the dialog box, the prompt clips. To create a multiline list box prompt, specify the prompt as a cell array or string array. Line breaks occur between each array element. Long elements wrap to fit the dialog box."
Your prompt string is longer than the width of the box. You could try the following.
[w,~] = listdlg('PromptString',["Select a wing for ",...
"individual number " + num2str(indx)],...
'SelectionMode','single','ListString',"Happy");
  댓글 수: 1
Ziv Kassner
Ziv Kassner 2020년 3월 28일
thank you so much,
worked very well.
Ziv

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Events and Mode Charts에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by