[Tex/LaTex] Matrix in latex using border matrix

bordermatrixoverleaf

I have written this in latex:

\begin {equation}
\label{E:1}
A={\frac{w_i}{w_j}} = {a_{ij}} ={\bbordermatrix{& C_1     & C_2     & C_\ldots & C_n \cr
    C_1     & (w_1/w_1)=1     & (w_1/w_2)=a_{12}     & \ldots & (w_1/w_n)=a_{1n} \cr
    C_2     & (w_2/w_1)=1/a_{12}     & (w_2/w_2)=1     & \ldots & (w_2/w_n)=a_{2n} \cr
    \vdots & \vdots & \vdots & \ddots & \vdots \cr
    C_n     & (w_n/w_1)=1/a_{1n}     & (w_n/w_2)=1/a_{2n}     & \ldots  & (w_n/w_n)=1 \cr}}
\end {equation}

And I found this:

Missing { inserted.

Check that your $'s match around math expressions. If they do, then you've probably used a symbol in normal text that needs to be in math mode. Symbols such as subscripts ( _ ), integrals ( \int ), Greek letters ( \alpha, \beta, \delta ), and modifiers (\vec{x}, \tilde{x} ) must be written in math mode. See the full list here.If you intended to use mathematics mode, then use $ … $ for 'inline math mode', $$ … $$ for 'display math mode' or alternatively \begin{math} … \end{math}.

Learn more

\mathinner
l.393 …)=1/a_{2n} & \ldots & (w_n/w_n)=1 \cr}
}
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
If you're confused by all this, try typing `I}' now.

! Missing } inserted.

}
l.393 …)=1/a_{2n} & \ldots & (w_n/w_n)=1 \cr}
}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.

I have tried to find this problem, but I couldn't find anything.

Can someone help me? Thanks in advance.

Best Answer

Just drop the \ldots inside the {} in the first row and you should be good to go.

\documentclass[10pt,a4paper]{article}
\begin{document}
    \begin {equation}
    \label{E:1}
    A={\frac{w_i}{w_j}} = {a_{ij}} =\bordermatrix{~ & C_1     & C_2     & C_{\ldots} & C_n \cr
    C_1     & (w_1/w_1)=1     & (w_1/w_2)=a_{12}     & \ldots & (w_1/w_n)=a_{1n} \cr    
\vdots & \vdots & \vdots & \ddots & \vdots \cr
C_n     & (w_n/w_1)=1/a_{1n}     & (w_n/w_2)=1/a_{2n}     & \ldots  & (w_n/w_n)=1 \cr}
    \end {equation}
\end{document}

this is what you would get out of it:

enter image description here