MATLAB Answers

sermet

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

Asked by sermet
on 19 Jul 2013

%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 Comment

Jan Simon
on 19 Jul 2013

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.

Products

No products are associated with this question.

1 Answer

Answer by Evan
on 19 Jul 2013
 Accepted answer

Assuming you created your GUI using GUIDE:

set(handles.edit1,'String',scale)

  10 Comments

sermet
on 19 Jul 2013

ok it works but why I cannot assign into empty edit without problem?

nl2605
on 19 Jul 2013

As I said, edit box is used to put inputs and not for displaying values.

sermet
on 19 Jul 2013

ok thank you so much.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today