geo_mean gives me error. Could it be a bug?

Hello

I use geo_mean() in constraint of my Geometric Programing model like this:

for p=1:phi for m=1:M for k=1:K geo_mean((1+(P(k,:,m,p).*chnl(k,:,m,p))),2,S(k,:,m,p))>=Q end; end; end;
where P and chnl and S are 4-D matrix of the same size equal to [K,4,M,phi]. Elements of S are binary and elements of P and chnl are nonnegative values.Q is a constant and my optimization variable is P.

The error I receive is:

Error using variable (line 116) Invalid dimension list: xw( nm-1, nv ) Dimension list must be a vector of finite nonnegative integers. Error in geo_mean_cone (line 309) variable xw( nm-1, nv ); Error in cvx/geo_mean (line 87) { cvx_accept_concave(xt), yt } == geo_mean_cone( size(xt), 1, w,'func' ); %#ok Error in anti_relax (line 37) geo_mean((1+(P(k,:,m,p).*chnl(k,:,m,p))),2,S(k,:,m,p))>=Q

Note that S(k,:,m,p) would never be all zero like this [0 0 0 0].
I traced the program and saw that when there is only one element 1 and three zero for example S(k,:,m,p)=[0 0 1 0], this error appears. And when there are more than one elements of 1, no error appears.

To my mind, it should not give error when S(k,:,m,p)=[0 0 1 0]. Can anybody help me solve this error? Is this a bug?

Thanks in advance,