Hi, I want to divide a 1x5872 matrix into 8x8 blocks. Can someone guide me please
3 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to divide a 1x5872 matrix into 8x8 blocks. Can someone guide me please.
0 件のコメント
回答 (1 件)
Geoff Hayes
2023 年 1 月 7 日
@javad danesh - you could use reshape to manipulate your array into a set of 8x8 blocks. Since 5872 is not divisible by 64, you would need to pad it. For example,
x = randi(256,1,5872);
xPadded = [x zeros(1,16)];
xReshaped = reshape(xPadded, 8, 8, length(xPadded)/64);
The first 64 elements of xPadded make up the first 8x8 block of xReshaped, etc.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!