MATLAB Answers

Field text- number

1 view (last 30 days)
john
john on 14 Mar 2012
Hi,
if I write integer number like 4 into field text, thens it is ok.
But when I write floating number like 4.5 into field text, then write error...
How can I do this?
Thanks
  2 Comments
Aldin
Aldin on 14 Mar 2012
I don't know but i quess this is what you want:
set(handles.edit1,'String',num2str(4.5));

Sign in to comment.

Accepted Answer

Aldin
Aldin on 14 Mar 2012
I have tested my code:
set(handles.edit1,'String',num2str(4.5));
It's correct.
  25 Comments
john
john on 20 Mar 2012
Great idea, find(string==',') is very helpfull, thank yuo again

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!