First will come the pretty complete theory. Then we look at your particular situation.
Theory: We need an expression for the variance of $X$. The variance is $E(X^2)-(E(X))^2$. For $E(X^2)$, we need to calculate $\int_a^b \frac{x^2}{b-a}\,dx,$ which is $\frac{b^3-a^3}{3(b-a)}$. This simplifies to $\frac{b^2+ab+a^2}{3}$.
I imagine that you know that $E(X)=\frac{b+a}{2}$. One can do this by integration, but it is clear by symmetry that the mean is halfway between $a$ and $b$.
So we know that the variance is $\frac{b^2+ab+a^2}{3}-\frac{(b+a)^2}{4}$. Bring to a common denominator, simplify. We get that $\text{Var}(X)=\frac{(b-a)^2}{12} \tag{$\ast$}.$ More simply, you can search under uniform distribution, say on Wikipedia. They will have the expression $(\ast)$ for the variance of $X$.
Your problem: We know that $\frac{b+a}{2}=3.5$. We also know that the standard deviation of $X$ is $1.3$, so the variance is $(1.3)^2=1.69$.
So, by $(\ast)$, $\frac{(b-a)^2}{12}=1.69$, and therefore $b-a=\sqrt{(12)(1.69)}\approx 4.5033$. We also know that $b+a=(2)(3.5)=7$. Now that we know $b-a$ and $b+a$, it is easy to find $a$ and $b$.
For your simulation, presumably you are starting from a random number generator that generates numbers that are more or less uniformly distributed on $[0,1)$. If $U$ represents the output of such a generator, we simulate $X$ by using $a+(b-a)U$. And we now know $a$ and $b$.
Added If you want a general formula instead of a procedure, let $\mu=\frac{a+b}{2}$ be the mean, and $\sigma=\frac{b-a}{\sqrt{12}}=\frac{b-a}{2\sqrt{3}}$ be the standard deviation. Then $\frac{b-a}{2}=\sqrt{3}\,\sigma$. We get $a=\frac{b+a}{2}-\frac{b-a}{2}=\mu-\sqrt{3}\,\sigma$. It follows that we can take $X=\mu-\sqrt{3}\,\sigma + (2\sqrt{3}\,\sigma) U=\mu+(\sqrt{3}\,\sigma)(2U-1).$