In Brubeck, Nakatsukasa, and Trefethen - Vandermonde with Arnoldi (example 3) they solve the following linear system: $$\operatorname{Re}\left(\begin{array}{ccc}1 & \cdots & z_{1}^{n} \\ 1 & \cdots & z_{2}^{n} \\ \vdots & \ddots & \vdots \\ 1 & \cdots & z_{m}^{n}\end{array}\right)\left(\begin{array}{c}a_{0} \\ \vdots \\ a_{n}\end{array}\right)-\operatorname{Im}\left(\begin{array}{ccc}z_{1} & \cdots & z_{1}^{n} \\ z_{2} & \cdots & z_{2}^{n} \\ \vdots & \ddots & \vdots \\ z_{m} & \cdots & z_{m}^{n}\end{array}\right)\left(\begin{array}{c}b_{1} \\ \vdots \\ b_{n}\end{array}\right) \approx \left(\begin{array}{c}f_{1} \\ f_{2} \\ \vdots \\ f_{m}\end{array}\right).$$$$\operatorname{Re}\left(\begin{array}{ccc}1 & \cdots & z_{1}^{n} \\ 1 & \cdots & z_{2}^{n} \\ \vdots & \ddots & \vdots \\ 1 & \cdots & z_{m}^{n}\end{array}\right)\left(\begin{array}{c}a_{0} \\ \vdots \\ a_{n}\end{array}\right)-\operatorname{Im}\left(\begin{array}{ccc}z_{1} & \cdots & z_{1}^{n} \\ z_{2} & \cdots & z_{2}^{n} \\ \vdots & \ddots & \vdots \\ z_{m} & \cdots & z_{m}^{n}\end{array}\right)\left(\begin{array}{c}b_{1} \\ \vdots \\ b_{n}\end{array}\right)\approx\left(\begin{array}{c}f_{1} \\ f_{2} \\ \vdots \\ f_{m}\end{array}\right).$$
Let us define $A=\left(\begin{array}{ccc}1 & \cdots & z_{1}^{n} \\ 1 & \cdots & z_{2}^{n} \\ \vdots & \ddots & \vdots \\ 1 & \cdots & z_{m}^{n}\end{array}\right)$.
For solving it, they use the following MATLAB code:
c = [real(A) imag(A(:,2:n+1))]\f;
c = c(1:n+1) - 1i*[0; c(n+2:2*n+1)];
The first line is equivalent to creating a vector c=[a,b]
where $\operatorname{Re}(A)a\approx f$ and $\operatorname{Im}(A(:,2:n+1))b \approx f$ and the second one means $c=a-[0,bi]$. I was wondering how it can be solved in this way, in fact I reproduced the code of the paper in Mathematica and the results are not the same. Is there any typo in this procedure?