2. Given that $f(x)$ is an odd function defined on $\mathbf{R}$, and the function $y=f(x+1)$ is an even function. When $-1 \leqslant x \leqslant 0$, $f(x)=x^{3}$. Then $f\left(\frac{9}{2}\right)=$ $\qquad$ .
2. $\frac{1}{8}$.

From the function $y=f(x+1)$ being an even function, we know
$$
f(-x+1)=f(x+1) \text {. }
$$

Since $f(x)$ is an odd function, then
$$
\begin{array}{l}
f(x+2)=f(-x)=-f(x), \\
f(x+4)=-f(x+2)=f(x) .
\end{array}
$$
$$
\begin{array}{l}
\text { Hence } f\left(\frac{9}{2}\right)=f\left(\frac{1}{2}\right)=-f\left(-\frac{1}{2}\right) \\
=-\left(-\frac{1}{2}\right)^{3}=\frac{1}{8} .
\end{array}
$$