Distribute matrix elements to smaller grids.

조회 수: 1 (최근 30일)
Sourangsu Chowdhury
Sourangsu Chowdhury 2019년 2월 3일
답변: Guillaume 2019년 2월 3일
I need to distribte matrix elements into a smaller grid size.
For example, I have a matrix with size 2x2
[10 20
30 40]
I want a matrix with size 4x4 by distributing the elements into a finer resolution.
[2.5 2.5 5 5
2.5 2.5 5 5
7.5 7.5 10 10
7.5 7.5 10 10]
I could do this using resizem and then dividing each element by 4. Is there any other efficient way to do this?

채택된 답변

Guillaume
Guillaume 2019년 2월 3일
Easily:
M = [10 20;
30 40];
scaling = 2;
repelem(M/scaling^2, scaling, scaling)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Antenna and Array Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by