Convert type while keeping values

2 次查看(过去 30 天)
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.

采纳的回答

KSSV
KSSV 2017-2-6
A = uint16([200 150 30]) ;
B = uint8(A) ;
class(A)
class(B)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by