display text in next line in edit box

tmp_str=['Name= Reema','class = MCS']; want to display class in next line in edit box how can i do this? i know about matlab little bit plz help

답변 (1개)

Image Analyst
Image Analyst 2014년 6월 1일

0 개 추천

tempString = sprintf('Name= Reema\nclass = MCS'); % Use backslash n for new line.
set(handles.string1, 'String', tempString);

댓글 수: 3

reema
reema 2014년 6월 1일
편집: reema 2014년 6월 1일
its not work .. my code is
old_str=get(handles.edit1, 'String');
tmp_str=['name=reema','class=MCS'];
new_str=[old_str; {tmp_str}];
set(handles.edit1, 'String', new_str);
i want to display text in edit box.shoulddisply like
name= reema
class= MCS
now tell me the code..
Image Analyst
Image Analyst 2014년 6월 1일
What does not work? Your code? I know since you told us already. That's why I gave you code like I use all the time and I know works . Why you chose to ignore it and not use it, I have no idea. Why did you refuse to use sprintf() like I recommended?
reema
reema 2014년 6월 2일
SIR SEE THIS gui:
I WANT WHEN ME CLICK ON TEST BUTTON THEN TEXT WILL SHOW IN EDIT BOX(WHICH HEADING IS PERSONAL INFORMATION)..NOW TELL ME HOW I CAN DISPLAY TEXT IN THIS EDIT BOX OR ME USE TEXTBOX, TO DISPLAY TEXT? IF I USE YOUR RECOMMENDED CODE BEHIND TEST BUTTON THEN NOTHING HAPPENED..CAN I EXPLAIN WELL?? DID YOU UNDERSTAND MY PROBLEM?

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

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2014년 6월 1일

댓글:

2014년 6월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by