Newer
Older
masterarbeit / usedMcode / shiftingMean.m
@Jan-Peter Hohloch Jan-Peter Hohloch on 24 Aug 2016 379 bytes fix flaws for different shifts
function [ output ] = shiftingMean( data,factor )
%shiftingMean downsampling by taking the mean
%   taking the mean of $factor data as new datum
    dataSize=size(data);
    output=zeros([fix(ceil(dataSize(1)/factor)),dataSize(2:end)]);
    for i=1:size(output,1)
        output(i,:)=mean(data(fix(round((i-1)*factor))+1:min(fix(round(i*factor)),dataSize(1)),:),1);
    end
end