Convert type while keeping values

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 日

0 投票

A = uint16([200 150 30]) ;
B = uint8(A) ;
class(A)
class(B)

その他の回答 (0 件)

カテゴリ

製品

タグ

質問済み:

Hg
2017 年 2 月 6 日

回答済み:

2017 年 2 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by