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

1 vue (au cours des 30 derniers jours)
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.

Réponse acceptée

Image Analyst
Image Analyst le 24 Oct 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);
  1 commentaire
Aditya
Aditya le 25 Oct 2011
Thank you very much for your comments. It has solved my problem.
Thanks again.Have a nice day!!

Connectez-vous pour commenter.

Plus de réponses (1)

Jan
Jan le 24 Oct 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.

Catégories

En savoir plus sur Scope Variables and Generate Names dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by