MATLAB Link for Code Composer Studio Development Tools    
convert

Change the represent property for an object from one datatype to another

Syntax

Description

convert(objname,datatype) returns objname with the represent property changed to the data type specified by datatype. Input argument datatype can be any supported datatype. After you change the datatype specified in represent, read or write operations apply the appropriate data conversion to implement on the target the datatype specified by the represent property.

The following datatypes work as input arguments to convert:

Datatype String
represent Property Value
'double'
'float'
'single'
'float'
'int32'
'signed'
'int16'
'signed'
'int8'
'signed'
'uint32'
'unsigned'
'uint16'
'binary'
'uint8'
'binary'
'long double'
'float'
'double_c'
'float'
'float'
'float'
'long'
'signed'
'int'
'signed'
'char'
'signed'
'unsigned long'
'signed'
'unsigned int'
'unsigned'
'unsigned char'
'binary'
'Q0.15'
'signed'
'Q0.31'
'unsigned'

Various TI processors restrict the sizes of the datatypes used by objects in MATLAB Link for Code Composer Studio. Shown in the next table, the processor families restrict the valid word sizes for the listed data types.

represent Property Value
C5x Processor Word Size Limits
C6x Processor Word Size Limits
'float'
32, 64 bits
32,64 bits
'signed'
16, 24, 32, 40, 48, 56, 64 bits
8, 16, 24, 32, 40, 48, 56, 64 bits
'unsigned'
16, 24, 32, 40, 48, 56, 64 bits
8, 16, 24, 32, 40, 48, 56, 64 bits
'binary'
16, 24, 32, 40, 48, 56, 64 bits
8, 16, 24, 32, 40, 48, 56, 64 bits

Using the properties of the objects, you change the word size by changing the value of the storageunitspervalue property of the object. Note that you cannot change the bitsperstorageunit property value which depends on the processor and whether the object represents a memory location or a register.

convert applies to any object that has the represent property. function, ccsdsp, and rtdx objects do not use the represent property and do not support convert.

convert(objname,datatype,size) returns objname with the specified datatype for the represent property, and the size property value set to size.

See Also

cast


  configure copy