We can derive a general formula for the PDF of $Z = X^2$, given the PDF of $X$ (denoted $f_X(x)$). Let's first compute the CDF of $Z$:
$F_Z(z) = \mathbb{P}(Z \leq z) = \mathbb{P}(X^2 \leq z) = \mathbb{P}(X \in [-\sqrt{z}, \sqrt{z}]) = \int_{-\sqrt{z}}^{\sqrt{z}} f_X(x) dx$.
We can differentiate the above expression w.r.t. $z$ to derive the PDF of $Z$ (of course, this is not completely rigorous and I am making assumptions about differentiability etc. here). In any case, we get:
$f_Z(z) = \frac{d}{dz}\int_{-\sqrt{z}}^{\sqrt{z}} f_X(x) dx = \frac{f_X(\sqrt{z}) + f_X(-\sqrt{z})}{2 \sqrt{z}}$.
Since you know $f_X(\cdot)$, you can evaluate $f_Z(\cdot)$ numerically in MATLAB or even analytically. You can also simplify the expression further if you know that $X$ is one-sided (e.g. exponential) or symmetric (e.g. Guassian).