How to assisgn char data into empty Edit Text in Matlab GUI ?

%I have a data which its class is char. I need to write this data into edit text in my GUI.
tp=0.99954;
scale_ppm=(tp-1)*10^6 %ppm
scale=sprintf('scale %10.4f ppm \n',scale_ppm) %char
%I want to assign "scale" into edit text (tag is edit1) in my GUI. Which codes exactly I need to use?
thanks in advance.

댓글 수: 1

This is almost the same question as http://www.mathworks.com/matlabcentral/answers/82444-set-handles-function-for-char-data. Please do not post questions twice. If you need tiny changes, add the new information and mark them by an "[EDITED]" tag in the text.

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

 채택된 답변

Evan
Evan 2013년 7월 19일
Assuming you created your GUI using GUIDE:
set(handles.edit1,'String',scale)

댓글 수: 10

it gives this error:
Warning: Single line Edit Controls can not have multi-line text
You can change the 'Max' property of your edit text box. That should avoid the error.
I changed it I tried 2-3-4 but it doesn't changed
I mean it still gives the error.
Hey if you just want to show the data 'scale' why don't you use static text instead of Edit text?
it change anything?
Static Text is usually used to dislay values. edit text is used to input values. If you just want to display your result you should use Static text.
ok it works but why I cannot assign into empty edit without problem?
As I said, edit box is used to put inputs and not for displaying values.
ok thank you so much.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2013년 7월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by