Duplicate the element n times for specific dimension

2 views (last 30 days)
Dear all,
I have a matix. The size is 22x15x30x4000 (316800000 double)
I would average the elements in last dimension between 1001:3000, and duplicate this value 4000 times in the last dimension. The size is also 22x15x30x4000.
Could anyone help me?

Answers (1)

Rik
Rik on 6 Jul 2020
Use subindexing, the mean function, and repmat.

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!