You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: moveMedian.m
    path of file: ./repos/acycle/code/seriesanalysis
    
    the code of the file until where you have to start completion: function y = moveMedian(x,w)
%

    
function y = moveMedian(x,w)
%
% moveMedian returns an array of local w-point median values, 
%   where each median is calculated over a sliding window of length w 
%   across neighboring elements of x. 
%   When w is odd, the window is centered about the element in the current position. 
%   When k is even, the window is centered about the left element near the center. 
%   The window size is automatically truncated at the end