Filter löschen
Filter löschen

Repeat 3D matrix in 4D

10 Ansichten (letzte 30 Tage)
Mantas Vaitonis
Mantas Vaitonis am 18 Jul. 2018
Kommentiert: Mantas Vaitonis am 18 Jul. 2018
Hello,
I suppose it is not hard, but I need to repeat 3D matrix a (NxMxL) in to 4D b (NxMxMxL). What I need is to repeat each 2D page of 3D matrix M times (which is columns) in 4D. If try:
b=repmat(a,1,1,1,L) ;
Result is b (NxMxLxL), what would be the correct way to do this?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 18 Jul. 2018
b = repmat( reshape(a, size(a,1), size(a,2), 1, size(a,3)), 1, 1, size(a,2), 1);
  1 Kommentar
Mantas Vaitonis
Mantas Vaitonis am 18 Jul. 2018
Yes this is exactly what I need.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by