ike this:  

weight = logspace(1,0,6)

wmean(y,weight)

%% Example 2: 2D matrix
% Here's a 2D matrix |A|, and just like in Example 1 we'll start by using 
% equal weights across the board: 

% A data matrix: 
A = [0 1 2 
     2 3 4
     4 5 6
     6 7 8]

% Equal weights everywhere:  
w = ones(size(A))

wmean(A,w)

%%
% If you need to operate across rows instead of down the columns of |A|, 
% specify dimension 2 as follows: 

wmean(A,w,'dim',2) 

%% 
% If you're following along at home, you can prove to you