If you have a dataset where the mean is zero and the amplitude is within the interval [0 1], then the entire dataset is zero-valued. In order for the data range to span the interval, the mean must not equal either interval extrema.
I'm going to assume you mean either an interval of [0 1] and a mean of 0.5, or an interval of [-1 1] and a mean of 0.
With simple scaling and translation, you can do one of two things:
- adjust the data to fit within an interval, with a new mean within that interval
- adjust the data to span an interval, where the relationship between mean and extrema is unchanged
The expression you give indicates that you want the data to span the interval. Can you distort the symmetry of the data such that both constraints are met? Yes. Is that what you want? Is that appropriate for the analysis?
Disregarding the latter possibility, consider the examples:
x = linspace(0,6*pi,100);
plot([0 6*pi],[1 1]*mean(y),':')
yspan = (y-min(y))./(max(y)-min(y));
clf; plot(x,yspan); hold on
plot([0 6*pi],[1 1]*mean(yspan),':')
os = max(abs(mean(y)-min(y)),abs(mean(y)-max(y)));
yfitmean = (y-mean(y))./(2*os) + newmean;
clf; plot(x,yfitmean); hold on
plot([0 6*pi],[1 1]*mean(yfitmean),':')