Convert type while keeping values

1 visualización (últimos 30 días)
Hg
Hg el 6 de Feb. de 2017
Respondida: KSSV el 6 de Feb. de 2017
How to convert the type of an array while keeping the value of all elements? For example, A = [200 150 30] in uint16 to B = [200 150 30] in uint8.

Respuesta aceptada

KSSV
KSSV el 6 de Feb. de 2017
A = uint16([200 150 30]) ;
B = uint8(A) ;
class(A)
class(B)

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by