三次元の形状変換

9 vues (au cours des 30 derniers jours)
sz
sz le 29 Oct 2021
現在19×231250×19の3次元行列があります。
これを19×19×231250にして、
19×19の361個分を一つの列に並べて231250×361の二次元行列に変更したいのですが出来ません。
スクリプトが分かれば送っていただきたいです。
19×231250×19の行列は下記の乱数ので大丈夫です。
よろしくお願いいたします.
X=rand([19,231250,19])

Réponse acceptée

Atsushi Ueno
Atsushi Ueno le 29 Oct 2021
X = rand([19,231250,19]); % 現在19×231250×19の3次元行列があります
Y = permute(X,[1 3 2]); % これを19×19×231250にして
Z = reshape(Y,[361,231250]); % 19×19の361個分を一つの列に並べて
A = Z'; % 231250×361の二次元行列に変更
size(X)
ans = 1×3
19 231250 19
size(Y)
ans = 1×3
19 19 231250
size(Z)
ans = 1×2
361 231250
size(A)
ans = 1×2
231250 361

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!