Decimate every row in a matrix
9 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have an array 26X10600 and have successfully managed to decimate the data to the required factor, however the decimate function only applies this to the first row in the array.
Is there a way to apply the decimate function to all the rows in the array? Perhaps using a loop?
Thanks in advance,
Ed.
0 件のコメント
回答 (1 件)
Chunru
2022 年 9 月 14 日
% assume that decimate is used for downsampling
a = randn(100, 26); % time is along the column
[ns, nch] = size(a);
r = 5;
ns_down = floor(ns/r);
a_down = zeros(ns_down, nch);
for i=1:nch
a_down(:, i) = decimate(a(:, i), r);
end
% if you use resample
a_down = resample(a, 1, 5)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!