function [wvars] = wvar( coefs, win, moment)
%WVAR Summary of this function goes here
%  Detailed explanation goes here
[rw,cw]=size(coefs);

for i=1:rw
    for j=1:1:length(coefs)-win
        x=coefs(i,j:j+win);
        x=x';
        x_mean=sum(x)/win;
        x_mean=repmat(x_mean,win,1);
         
        for jj=1:win
              x_var(jj)=(x(jj)-x_mean(jj))^moment;
        end
    
    if j==1
        x_var_1(i,j)=sum(x_var)/(win-1);
    else
        h=((j-1)/1)+1;
        x_var_1(i,h)=sum(x_var)/(win-1);
    end
    
end
end
    %zx=zeros(rw,win);
    wvars=[x_var_1];