Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

Conversión de tipos de datos

Conversión entre arreglos numéricos, arreglos de caracteres, arreglos de celdas, estructuras o tablas

Funciones

charArray de caracteres
cellstrConvert to cell array of character vectors
int2strConvert integers to characters
mat2strConvert matrix to characters
num2strConvertir números a array de caracteres
str2doubleConvert strings to double precision values
str2numConvertir matriz de caracteres a matriz numérica
native2unicodeConvert numeric bytes to Unicode character representation
unicode2nativeConvert Unicode character representation to numeric bytes
base2decConvert text representing number in base N to decimal number
bin2decConvert text representation of binary number to decimal number
dec2baseConvert decimal number to character array representing base-N number
dec2binConvert decimal number to character array representing binary number
dec2hexConvert decimal number to character array representing hexadecimal number
hex2decConvert text representation of hexadecimal number to decimal number
hex2numConvert IEEE hexadecimal format to double-precision number
num2hexConvert single- and double-precision numbers to IEEE hexadecimal format
table2arrayConvert table to homogeneous array
table2cellConvert table to cell array
table2structConvert table to structure array
array2tableConvert homogeneous array to table
cell2tableConvert cell array to table
struct2tableConvert structure array to table
cell2matConvertir matriz de celdas a matriz ordinaria del tipo de datos subyacente
cell2structConvert cell array to structure array
mat2cellConvert array to cell array whose cells contain subarrays
num2cellConvert array to cell array with consistently sized cells
struct2cellConvert structure to cell array

Temas

Hexadecimal and Binary Values

Specify hexadecimal and binary values either as literals or as text. Hexadecimal and binary literals are stored as integers. You can convert text representing hexadecimal and binary values to numbers, and numbers to text representations.

Convert Text to Numeric Values

Convert text to arrays of numeric values. Text can represent floating-point values, dates and times, and hexadecimal and binary numbers. If text represents dates and times, then you can convert the text to datetime or duration values.

Convert Numeric Values to Text

Convert numeric values to text. Text can represent floating-point values with or without exponential notation, dates and times, or hexadecimal or binary digits.

Valid Combinations of Unlike Classes

If you include elements of unlike classes in a matrix, MATLAB® converts some elements so that all elements of the resulting matrix are of the same type. Data type conversion is done with respect to a preset precedence of classes.