Not silly at all, however it may not produce the result you want.
It might be more appropriate to calculate the errors as the standard error of the mean (S.E.M.) :
err = 2*(std(y,,2)/sqrt(size(y,2)));
errorbar(x, mean(y,2), err)
rather than the standard deviation of the observations themselves.