how can i declare an array
이전 댓글 표시
i have to calculate then moving average of a filter so that i need the function y(t) to be an array
댓글 수: 1
Azzi Abdelmalek
2015년 8월 20일
What function? your question is not clear
답변 (1개)
Image Analyst
2015년 8월 20일
Try conv(), filter() or rsmooth()
% Filter array t with a moving average of window width windowWidth.
% Smoothed, averaged array movingAverage is the same length as input array t.
function movingAverage = y(t, windowWidth)
if windowWidth < 1
windowWidth = 1;
end
if windowWidth > length(t);
windowWidth = length(t);
end
movingAverage = conv(t, ones(1, windowWidth), 'same');
카테고리
도움말 센터 및 File Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!