How can I add an equation number to a special matrix

I want to assign an equation number to the following matrix equation; I want a number in brackets on the right side, after the equation.

 \documentclass{article}
\usepackage{rotating}
\usepackage{kbordermatrix}
\begin{document}
$C = \raisebox{-2\baselineskip}{% \begin{tabular}[b]{c@{\hspace*{0.5em}}c} & To node \\ \begin{sideways} From node \end{sideways} & \raisebox{0.5\height}% {$$\kbordermatrix { & 1 & 2 & 3 & 4 & 5 \\ 1 & 1 & x_1 & x_5 & 0 & 0 \\ 2 & x_1 & 1 & x_2 & x_3 & x_4 \\ 3 & x_5 & x_2 & 1 & x_6 & 0 \\ 4 & 0 & x_3 & x_6 & 1 & x_7 \\ 5 & 0 & x_4 & 0 & x_7 & 1 }$$% } \end{tabular}}$
\end{document}


As shown in the picture. I tried several attempts but errors appear.

• Change $...$ to $$...$$. – Steven B. Segletes Nov 7 '17 at 17:42

\documentclass{article}
% $$$% here C = \raisebox{-2\baselineskip}{% \begin{tabular}[b]{c@{\hspace*{0.5em}}c} & To node \\ \begin{sideways} From node \end{sideways} & \raisebox{0.5\height}% {$$\kbordermatrix { & 1 & 2 & 3 & 4 & 5 \\ 1 & 1 & x_1 & x_5 & 0 & 0 \\ 2 & x_1 & 1 & x_2 & x_3 & x_4 \\ 3 & x_5 & x_2 & 1 & x_6 & 0 \\ 4 & 0 & x_3 & x_6 & 1 & x_7 \\ 5 & 0 & x_4 & 0 & x_7 & 1 }$$% } \end{tabular}} %$$$