how to set value in edit text box.

i am having a problem i want to disply a number 'e.g 1000' in edit text box without using any pushbutton or anything....
i am writing this code in the call back function of edit_text but it doesn't give me the result.tag is edit1.
a=1000;
set(handles.edit1,'string',a);
please tell me how i can do that........waitng for your response reply sooon
Shahid Imran

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 30일
편집: Azzi Abdelmalek 2012년 8월 30일

8 개 추천

a=1000; set(handles.edit1,'string',num2str(a));
% a is double, you need to convert it to string

댓글 수: 1

VALARMATHY K
VALARMATHY K 2017년 10월 16일
can you please help me to do this
a=get(handles.edit2, 'string');
z=str2num(a); b= z+10000;
c = b;
d='Your Balance is: %g', c;
set(handles.edit1,'string',d);
msgbox( sprintf('Your Balance is %g', c) );
in my message box i am getting correct output but i want to do this in edit text box

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

zakaria
zakaria 2014년 6월 3일

0 개 추천

post from 2012, the s of 'string' have to be Uppercase
a=1000; set(handles.edit1,'String',a);
Camilo Cárdenas
Camilo Cárdenas 2022년 3월 16일

0 개 추천

Hi,
Somebody knows how to do it "set value in EditField" using Appdesigner?
Thankyou!

카테고리

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

태그

질문:

2012년 8월 30일

답변:

2022년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by