フィルターのクリア

How to reshape a 16x16x16x16 matrix to 256x256 whilst maintaining consistency

2 ビュー (過去 30 日間)
Michael
Michael 2012 年 11 月 13 日
Hi
I have a pixel grid (16,16) and I've generated a matrix A whose (i,j,k,l)th element specifies a property of the pairing of the pixel (i,j) with the pixel (k,l), for i,j,k,l = 1,...16.
Now let's say I have a separate 16-by-16 matrix "a" which I reshape to "b" such that "b = reshape(a,256,1)". I want to reshape A into a 256x256 matrix B according to this same rule, so that A(i,j,k,l) = B(m,n), where a(i,j) = b(m) and a(k,l) = b(n).
In other words, I need to reduce to a single dimension the 1,2 dimensions of A, and simultaneously the 3,4 dimensions, so that the new matrix B is consistent with all my other matrices which are consistent with the b = reshape(a,256,1) rule.
I'm far too confused to work out if this is achieved by a simple "reshape(A,256,256)", and I need to be certain before proceeding. Thanks for _any _help.
Mike

採用された回答

Matt J
Matt J 2012 年 11 月 13 日
編集済み: Matt J 2012 年 11 月 13 日
Yes, it's the same. But you can easily convince yourself using a few simple tests.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Filtering and Enhancement についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by