I try to solve these two difference equation ;
$$ \frac{dq}{dz} = -j\left(b_1q - kp\right),\\ \frac{dp}{dz} = -j\left(b_2p - kq\right) $$
where $j$ stands for $\sqrt{-1}$, and $b_1$ ,$b_2$ and k are constants and $q(0)$, $p(0)$ are initial values and $z \in [0, 10]$.
I try to solve these equations analytically by assuming a general formula for the solution on the form $\exp(Cz)$ (where $C$ is a constant) and substitute this form into the two equations and get the solution shown in the attached image where $A$, $B$, $D$ constant related to $b_1$, $b_2$, $k$.
Is this solution correct or not? I try to get the solution numerically using matlab (using ode45 function) but I didn't get the same answer

Instead of guessing an ansatz you can try to calculate the matrix $e^{Az}$ instead, once you put your first order system into matrix form:
$$ \underbrace{ \frac{d}{dz} \left[ \begin{matrix} q \\ p \end{matrix} \right] }_{x'} = \underbrace{ \left[ \begin{matrix} -i b_1 & i k \\ i k & -i b_2 \end{matrix} \right] }_A \, \underbrace{ \left[ \begin{matrix} q \\ p \end{matrix} \right] }_x \iff x'(z) = A \, x(z) $$
this has the solution
$$ x(z) = e^{Az} x(0) $$
Verifying your solution is just a matter of putting the solutions into the differential equation system and check if they fullfill them.
You should rather use a computer algebra system, if you don't like to calculate the derivatives by hand. Checking the numerical values is not bad as a first test, but less ensuring.