reshape 8bit matrix to 16 bit matrix

2 ビュー (過去 30 日間)
Houssam
Houssam 2021 年 5 月 22 日
回答済み: Matt J 2021 年 5 月 22 日
Hi Community
I have a matrix sized 1024 * 512 of 8 bit elements
and i need to convert it to a matrix of 512 * 512 of 16 bit elements
i tried reshape but it doesn't work !!!
eg:
thid matrix :
16 16 32 32
48 48 64 64
will becom
4112 8224
12336 16448
any one can help me pleaze

回答 (1 件)

Matt J
Matt J 2021 年 5 月 22 日
A=[16 16 32 32
48 48 64 64];
B= A(:,1:2:end)*256 + A(:,2:2:end)
B = 2×2
4112 8224 12336 16448

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by