how to set value in edit text box.

11 vues (au cours des 30 derniers jours)
shahid
shahid le 30 Août 2012
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
  1 commentaire
Walter Roberson
Walter Roberson le 2 Sep 2012
Please read the guide to tags and retag this question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

Connectez-vous pour commenter.

Réponses (3)

Azzi Abdelmalek
Azzi Abdelmalek le 30 Août 2012
Modifié(e) : Azzi Abdelmalek le 30 Août 2012
a=1000; set(handles.edit1,'string',num2str(a));
% a is double, you need to convert it to string
  1 commentaire
VALARMATHY K
VALARMATHY K le 16 Oct 2017
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

Connectez-vous pour commenter.


zakaria
zakaria le 3 Juin 2014
post from 2012, the s of 'string' have to be Uppercase
a=1000; set(handles.edit1,'String',a);

Camilo Cárdenas
Camilo Cárdenas le 16 Mar 2022
Hi,
Somebody knows how to do it "set value in EditField" using Appdesigner?
Thankyou!

Catégories

En savoir plus sur Desktop 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