Find the matrix A with respect to the standard bases 
Let $V=\mathbb{R}^4$, let $W=\mathbb{R}^3$ and let $\phi$ be the
  linear map $$\left(x,y,z,t\right)\rightarrow
 \left(x-2z+t,2y+z,x+4y+t\right)$$
Write down the matrix of A of $\phi$ with respect to the standard
  bases of $\mathbb{R}^4$ and $\mathbb{R}^3$.

Could someone please help me with the method for finding the matrix A.
I understand we use the standard bases of $\mathbb{R}^4$: 
$$e_1=\left(1,0,0,0\right), e_2=\left(0,1,0,0\right), e_4=\left(0,0,1,0\right), e_4=\left(0,0,0,1\right)$$
and the standard bases of $\mathbb{R}^3$:
$$f_1=\left(1,0,0\right), f_2=\left(0,1,0\right), f_3=\left(0,0,1\right)$$
But I'm not sure how.
 A: First, we need to check where our basis for $\mathbb{R}^4$ is sent. 
$$e_1\mapsto (1,0,1)=f_1+f_3$$
$$e_2\mapsto (0,2,0)=2f_2+4f_3$$
$$e_3\mapsto (-2,1,0)=-2f_1+f_2$$
$$e_4\mapsto (1,0,1)=f_1+f_3$$
So, using the matrix "algorithm"
$$ A=\begin{bmatrix}
1&0&-2&1\\
0&2&1&0\\
1&4&0&1\\
\end{bmatrix}.$$
More precisely: given a linear transformation $T:V\to W$, where $V$ and $W$ are abstract vector spaces (over $\mathbb{F}$) with bases $v_1,\ldots,v_n$ and $w_1,\ldots,w_m$ respectively, the $i^{th}$ column of the matrix representing $T$ with respect to these bases is 
$$ \begin{pmatrix}
a_{1,i}\\
\vdots\\
a_{m,i}
\end{pmatrix}.$$
Here the $a_{j,i}\in\mathbb{F}$ are the coefficients satisfying 
$$ T(v_i)=\sum_{k=1}^m a_{k,i}w_k.$$
A: Hint: Look at the images of the basis elements of $\mathbb{R}^4$. The images will span the image of the map. That is, you can write any element in the image as a linear combination of the images of the basis elements. Thus your matrix will have the images of the basis vectors of $\mathbb{R}^4$ as its columns. 
A: You apply $\phi$ to the base vectors $e_i$ and express it in terms of the base factors $f_i$:
$$
\phi(e_1) = (1, 0, 1) = f_1 + f_3 \\
$$
etc. In matrix form
$$
(\phi(e_j))_i = \sum_{j=1}^3 a_{ij} f_j
$$ 
this gives
$$
A = 
\begin{pmatrix}
1 & 0 & -2 & 1 \\
0 & 2 & 1 & 0 \\
1 & 4 & 0 & 1 
\end{pmatrix}
$$
