Decimate every row in a matrix
    10 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
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 Commenti
Risposte (1)
  Chunru
      
      
 il 14 Set 2022
        % 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 Commenti
Vedere anche
Categorie
				Scopri di più su Multirate Signal Processing in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

