필터 지우기
필터 지우기

I am getting this warning after applying my string to a text box.'Single line Edit Controls can not have multi-line text'

조회 수: 5 (최근 30일)
This is the part of my code after which its throwing me the warning
_ set(cal_glbl_data.out_msg_solver,'String',char({'Computation in progress ... ' cal_glbl_data.cals{1} num2str(print_x)}))_
Here cal_glbl_data.out_msg_solver contains the handle of the text box while cal_glbl_data.cals{1} contains another string and print_x contains a number.
As soon as matlab executes above line the text box disappears and the following warning is displayed on the command window
Pleae help me out in this condition.

채택된 답변

Image Analyst
Image Analyst 2011년 10월 24일
Make sure the 'Max' property of your edit text box is set to 2 so that you can have multi-line text strings in it. If it's 1 you can have only single line.
set(cal_glbl_data.out_msg_solver, 'Max', 2);

추가 답변 (1개)

Jan
Jan 2011년 10월 24일
The string you want to insert in the textbox is:
Str = char({'Computation in progress ... ',
cal_glbl_data.cals{1}, ...
num2str(print_x)})
The char command converts the {1 x 3} cell string into a [3 x N] CHAR matrix. But the peroperty must be a string, which is a [1 x N] CHAR vector.
I guess you want:
Str = ['Computation in progress ... ',
cal_glbl_data.cals{1}, ...
num2str(print_x)];
You can use the debugger to find such problems by your own: Set a breakpoint in the corresponding line and check the results in the command window.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by