  We construct a homomorphism from the affine Yangian associated with
$\widehat{\mathfrak{sl}}(q_u-q_{u+1})$ to the universal enveloping algebra of a
$W$-algebra associated with $\mathfrak{gl}(\sum_{s=1}^lq_s)$ and a nilpotent
element of type $(1^{q_1-q_2},2^{q_2-q_3},\dots,(l-1)^{q_{l-1}-q_l},l^{q_l})$
by using the coproduct and evaluation map for the affine Yangian and the Miura
map for non-rectangular $W$-algebras. As an application, we give a homomorphism
from the affine Yangian to some cosets of non-rectangular $W$-algebras.
