The hilbert
function in MATLAB will return an FFT based approximation of the Analytic Signal, and the magnitude of the analytic signal is the "envelope", but this isn't the "complex envelope" the OP refers to.
The analytic signal is given as:
$$x_a(t) = x(t) + j\mathscr{H}\{x(t)\} \tag{1} \label{1}$$
Where $\mathscr{H}\{x(t)\}$ is the actual Hilbert transform of $x(t)$.
Note that in general the analytic signal $x_a(t)$ is a complex values signal that can be expressed in terms of AM and PM signals, or as in the OP's case, a complex envelope at a fixed carrier. The two forms are listed below, starting with the AM and PM form:
$$x_a(t)= A(t)e^{j\phi(t)} \tag{2} \label{2}$$
Where $A(t)$ is a real valued waveform representing amplitude modulation, and $\phi(t)$ is a real valued waveform representing phase modulation.
The analytic signal using a complex envelope at a fixed carrier is given here as:
$$x_a(t) = x_c(t)e^{j2\pi f_c t} \tag{3} \label{3}$$
Where $x_c(t)$ is a complex waveform as the complex envelope of $x(t)$ and $f_c$ is the carrier frequency for that envelope.
To extract the complex envelope from the analytic signal, we must define $f_c$ and then from that we can solve for the complex envelope directly from \ref{3} as follows:
$$x_c(t) = x_a(t)e^{-j2\pi f_c t}\tag{4} \label{4}$$
The OP's case is simple enough to do by inspection but I will show the details below on how it would be computed, with $x_a(t)$ as given below is the analytic signal as would be returned by MATLAB's hilbert
function:
$$x(t) = A_c\cos(2\pi f_c t + \phi)$$
$$x_a(t) = A_c\cos(2\pi f_c t + \phi) + jA_c\sin(2\pi f_c t + \phi) = A_c e^{j( 2\pi f_c t + \phi)}$$
using \ref{4}:
$$x_c(t) = x_a(t)e^{-j2\pi f_c t} = A_ce^{j\phi}$$