I am getting this warning after applying my string to a text box.'Single line Edit Controls can not have multi-line text'
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 24 Okt. 2011
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);
Weitere Antworten (1)
Jan
am 24 Okt. 2011
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Scope Variables and Generate Names finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!