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.

 Akzeptierte Antwort

KSSV
KSSV am 6 Feb. 2017

0 Stimmen

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

Weitere Antworten (0)

Produkte

Tags

Gefragt:

Hg
am 6 Feb. 2017

Beantwortet:

am 6 Feb. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by