ascii

Respuestas (2)

Walter Roberson
Walter Roberson el 16 de Ag. de 2011

1 voto

Yes, but chances are that you have asked the wrong question. The function is named unicode2native(), and in the case of translating to US-ASCII, what it mostly does is convert any character outside the range decimal 0 through decimal 127 in to the value decimal 26 (intended to signify that US-ASCII has no way of representing the corresponding character.)
ASCII is really a pretty restricted set of values. The question does get interesting, though, if you do not restrict yourself to US-ASCII and start wanting to do things like translate the "national currency symbol" of UK-ASCII vs US-ASCII vs the symbols used in the Scandinavian languages...
Fangjun Jiang
Fangjun Jiang el 16 de Ag. de 2011

0 votos

double('A')
double('0')
char(65)
char(55)

3 comentarios

huda nawaf
huda nawaf el 17 de Ag. de 2011
thanks.
what is inverse double
where, the function return character
thanks
Fangjun Jiang
Fangjun Jiang el 17 de Ag. de 2011
char(97)
Walter Roberson
Walter Roberson el 17 de Ag. de 2011
The MATLAB character set represented by the 'char' data type is NOT ASCII. It is not completely documented as to what it _is_, but it it holds values from 0 to 65535, a 16 bit representation, but the mapping from values to character set appears to be left up to preferences or system variables rather than being fixed. It is _not_ UTF-16.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de Ag. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by