Making amount of two matrix same by smoothing one of them

1 回表示 (過去 30 日間)
Lia Kirtadze
Lia Kirtadze 2022 年 8 月 24 日
回答済み: Abderrahim. B 2022 年 8 月 24 日
Hello
I have two matrix
One of those matrix consists of 3000 data points and another matrix consists of 600 da apoints. In this particular case I want to get 600 data points from 3000 by moving avarage smoothing if it is possible. Generally I want to write code which will help me to decrease data with more points by moving avarage smoothing and make it equal to the number of data points of another matrix.

回答 (1 件)

Abderrahim. B
Abderrahim. B 2022 年 8 月 24 日
Hi!
TRy this :
A = randi(10, 3000, 1) ;
n = 5; % average length - 3000/600
newA = mean(reshape(A, n, []))
newA = 1×600
6.6000 7.8000 4.8000 5.2000 5.8000 7.8000 5.6000 6.0000 3.6000 6.2000 5.6000 6.0000 6.0000 5.8000 5.6000 4.8000 4.8000 4.0000 5.4000 5.4000 3.8000 4.4000 5.0000 5.6000 6.2000 6.4000 7.2000 5.2000 6.6000 7.6000
Hope this helps

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by