Filter löschen
Filter löschen

Problem converting double to char usin char

47 Ansichten (letzte 30 Tage)
Johan
Johan am 20 Jun. 2012
Hi! I'm trying to convert a double-variable to a char-variable using char but i all ends up with: >> Value=5; char(Value)
ans =
>> whos ans Name Size Bytes Class Attributes
ans 1x1 2 char
how do I get ans=5 with Class char?
Best Regards
Johan

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Jun. 2012
sprintf('%g', Value)
or
num2str(Value)

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by