Define east/west anchors for a matrix with one column

I have the following code:

\documentclass{article}
\usepackage{amsmath}
\usepackage[margin=0.5in]{geometry}
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{sideways}
\begin{tikzpicture}[
%%---------------------------------------
%%---------------------------------------
]
\matrix (ae) [matrix of nodes,
column 1/.style={anchor=west},
column 6/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
nodes in empty cells,
]
{
$x(0)$ &  $0$   & $0$ & $---$ & $---$  & $0$ \\
$x(1)$ & $x(0)$ & $0$ & $---$ & $---$  & $0$ \\
$x(2)$ & $x(1)$ & $x(0)$ &       &       & $|$ \\
$|$   &  $|$   &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$x(p-1)$ & $x(p-2)$ & $x(p-3)$ & $---$ & $x(0)$& $0$\\
$x(p)$   & $x(p-1)$ & $x(p-2)$ & $---$ & $---$ & $x(0)$\\
$x(p+1)$ & $x(p)$   & $x(p-1)$ & $---$ & $---$ & $x(1)$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$x(N-1)$ & $x(N-2)$ & $x(N-3)$ & $---$ & $---$ & $x(N-1-p)$\\
$0$ & $x(N-1)$ & $x(N-2)$ & $---$ & $---$ & $x(N-p)$\\
$0$ & $0$ & $x(N-1)$ & $---$ & $---$ & $x(N-p+1)$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$0$ & $0$ &   $0$    & $---$ & $---$ & $x(N-1)$\\
};

% Vertical lines at the left corner
\draw[line width=0.6pt] ($(ae-1-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-7-1.south west)-(10ex,0)$) node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-10-1.west)-(10ex,0)$) node[] {\textbullet} -- ($(ae-12-1.south west)-(10ex,0)$)
node[left,xshift=-1mm] {$N - p$} node[yshift=-1mm] {$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(10ex,0)$) -- ($(ae-15-1.west)-(10ex,0)$)
node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-16-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-22-1.west)-(10ex,0)$) node[] {\textbullet};

% Left side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ++(5mm, 0);
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ($(ae-12-1.south west)-(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(6ex,0)$) -- ($(ae-22-1.south west)-(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-1.south west)-(6ex,0)$) -- ++(5mm, 0);

% Right side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ++(-5mm, 0);
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ($(ae-12-6.south east)+(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-6.north east)+(6ex,0)$) -- ($(ae-22-6.south east)+(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-6.south east)+(6ex,0)$) -- ++(-5mm, 0);

\begin{scope}[xshift=7cm]
\matrix (be) [matrix of math nodes,
left delimiter={[},
right delimiter={]},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
1\\
a_p(1)\\
a_p(2)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
a_p(p)\\
};
\end{scope}

\begin{scope}[xshift = 9cm, right of=be]
\matrix (ce) [matrix of math nodes,
column 1/.style={anchor=west},
%column 1/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
e(0)\\
e(1)\\
e(2)\\
\mid\\
\mid\\
\mid\\
e(p - 1)\\
e(p)\\
\\
e(p + 1)\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1)\\
e(N)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1 + p)\\
};

% Left side delimiter
\draw[line width=0.6pt] ($(ce-1-1.north west)-(6ex,0)$) -- ++(5mm, 0);
\draw[line width=0.6pt] ($(ce-1-1.north west)-(6ex,0)$) -- ($(ce-12-1.south west)-(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ce-13-1.north west)-(6ex,0)$) -- ($(ce-22-1.south west)-(6ex,0)$);
\draw[line width=0.6pt] ($(ce-22-1.south west)-(6ex,0)$) -- ++(5mm, 0);

% Right side delimiter
\draw[line width=0.6pt] ($(ce-1-1.north east)+(6ex,0)$) -- ++(-5mm, 0);
\draw[line width=0.6pt] ($(ce-1-1.north east)+(6ex,0)$) -- ($(ce-12-1.south east)+(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ce-13-1.north east)+(6ex,0)$) -- ($(ce-22-1.south east)+(6ex,0)$);
\draw[line width=0.6pt] ($(ce-22-1.south east)+(6ex,0)$) -- ++(-5mm, 0);

% Right side lines
\draw[line width=0.6pt] ($(ce-10-1.east)+(10ex,0)$) node[] {\textbullet} -- ($(ce-12-1.south east)+(10ex,0)$)
node[right,xshift=1mm] {COVAR} node[yshift=-1mm] {$\approx$};
\draw[line width=0.6pt] ($(ce-13-1.north east)+(10ex,0)$) -- ($(ce-15-1.east)+(10ex,0)$)
node[] {\textbullet};
\end{scope}
\end{tikzpicture}
\end{sideways}
\end{document}


which gives the following:

As you can see the matrix on the right side, the right delimiter and the vertical line are not straight. I know what's the cause but don't know how to fix it. I wanted to define two anchors : one west and the other east for a one column size matrix. How to do that ?

Any comment or suggestion is welcome Thanks in advance

• Would need some more work for a complete answer, but you could add \usetikzlibrary{arrows.meta} and do something in the direction of \draw[line width=0.6pt] (ce.north east) -| node[pos=0.75]{$\approx$} ($(ce.south east)+(6ex,0)$) -- ++(-6ex,0); \draw[line width=0.6pt,Circle-Circle] ($(ce.east)+(12ex,7ex)$) -- node [label=right:COVAR] {$\approx$} ++(0,-14ex); – Torbjørn T. Mar 4 '18 at 23:18

In this answer, I only focus on the last part and only on making the lines straight. (Personally, I would take a different route and make the brackets with LaTeX commands and put some TikZ annotations on top.) The main messages are:

1. load the positioning library for better and simpler placement of nodes.
2. Use the (x|-y) (and (x-|y)) directives for placing nodes at the same x coordinate as x and y coordinate as y (or vice versa).

\documentclass{article}
\usepackage{amsmath}
\usepackage[margin=0.5in]{geometry}
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{sideways}
\begin{tikzpicture}[
%%---------------------------------------
%%---------------------------------------
]
\matrix (ae) [matrix of nodes,
column 1/.style={anchor=west},
column 6/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
nodes in empty cells,
]
{
$x(0)$ &  $0$   & $0$ & $---$ & $---$  & $0$ \\
$x(1)$ & $x(0)$ & $0$ & $---$ & $---$  & $0$ \\
$x(2)$ & $x(1)$ & $x(0)$ &       &       & $|$ \\
$|$   &  $|$   &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$x(p-1)$ & $x(p-2)$ & $x(p-3)$ & $---$ & $x(0)$& $0$\\
$x(p)$   & $x(p-1)$ & $x(p-2)$ & $---$ & $---$ & $x(0)$\\
$x(p+1)$ & $x(p)$   & $x(p-1)$ & $---$ & $---$ & $x(1)$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$x(N-1)$ & $x(N-2)$ & $x(N-3)$ & $---$ & $---$ & $x(N-1-p)$\\
$0$ & $x(N-1)$ & $x(N-2)$ & $---$ & $---$ & $x(N-p)$\\
$0$ & $0$ & $x(N-1)$ & $---$ & $---$ & $x(N-p+1)$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$0$ & $0$ &   $0$    & $---$ & $---$ & $x(N-1)$\\
};

% Vertical lines at the left corner
\draw[line width=0.6pt] ($(ae-1-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-7-1.south west)-(10ex,0)$) node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-10-1.west)-(10ex,0)$) node[] {\textbullet} -- ($(ae-12-1.south west)-(10ex,0)$)
node[left,xshift=-1mm] {$N - p$} node[yshift=-1mm] {$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(10ex,0)$) -- ($(ae-15-1.west)-(10ex,0)$)
node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-16-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-22-1.west)-(10ex,0)$) node[] {\textbullet};

% Left side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ++(5mm, 0);
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ($(ae-12-1.south west)-(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(6ex,0)$) -- ($(ae-22-1.south west)-(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-1.south west)-(6ex,0)$) -- ++(5mm, 0);

% Right side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ++(-5mm, 0);
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ($(ae-12-6.south east)+(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-6.north east)+(6ex,0)$) -- ($(ae-22-6.south east)+(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-6.south east)+(6ex,0)$) -- ++(-5mm, 0);

\begin{scope}[xshift=7cm]
\matrix (be) [matrix of math nodes,
left delimiter={[},
right delimiter={]},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
1\\
a_p(1)\\
a_p(2)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
a_p(p)\\
};
\end{scope}

\begin{scope}[xshift = 9cm, right of=be]
\matrix (ce) [matrix of math nodes,
column 1/.style={anchor=west},
%column 1/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
e(0)\\
e(1)\\
e(2)\\
\mid\\
\mid\\
\mid\\
e(p - 1)\\
e(p)\\
\\
e(p + 1)\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1)\\
e(N)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1 + p)\\
};

% Left side delimiter
\draw[line width=0.6pt] ($(ce-1-1.north west)-(6ex,0)$) -- ++(5mm, 0);
\draw[line width=0.6pt] ($(ce-1-1.north west)-(6ex,0)$) -- ($(ce-12-1.south west)-(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ce-13-1.north west)-(6ex,0)$) -- ($(ce-22-1.south west)-(6ex,0)$);
\draw[line width=0.6pt] ($(ce-22-1.south west)-(6ex,0)$) -- ++(5mm, 0);

% Right side delimiter
\coordinate (rt) at ($(ce-1-1.north east)+(6ex,0)$);
\coordinate (rb) at ($(ce-22-1.south east)+(6ex,0)$);
\draw[line width=0.6pt] ($(rb)-(5mm,0)$) -- (rb) -- (rt-|rb)
node[pos=0.47](app6){$\approx$}--
($(rt-|rb)-(5mm,0)$);
%             \draw[line width=0.6pt] ($(ce-1-1.north east)+(6ex,0)$) -- ++(-5mm, 0);
%             \draw[line width=0.6pt] ($(ce-1-1.north east)+(6ex,0)$) -- ($(ce-12-1.south east)+(6ex,0)$) node[yshift=-1mm]{$\approx$};
%             \draw[line width=0.6pt] ($(ce-13-1.north east)+(6ex,0)$) -- ($(ce-22-1.south east)+(6ex,0)$);
%             \draw[line width=0.6pt] ($(ce-22-1.south east)+(6ex,0)$) -- ++(-5mm, 0);
\node[right=0.3cm of app6] (app7){$\approx$};
% Right side lines
\draw[line width=0.6pt] (ce-10-1-|app7) node[] {\textbullet} --
(ce-15-1-|app7) node[] {\textbullet};
\node[right=1mm of app7] {COVAR};
\end{scope}
\end{tikzpicture}
\end{sideways}
\end{document}


your matrix expression i would write on the following way:

code for above matrices are simpler (and shorter). from math aspect drawing symbols for discontinues of matrices delimiters and range of matrices parts are superfluous. dots inside matrices clear state that they have more rows/columns as are written. even more, removing all this trimming make math expression more "math like".

matrices can be considered as nodes. for them are defined all anchors as for node with rectangle shape. therefore you can for complete matrices define other options as for example inner sep.

mwe:

%\documentclass{article}
\documentclass[margin=3mm]{standalone}
\usepackage{amsmath}
%\usepackage[margin=0.5in]{geometry}
%\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
calc,
decorations.pathreplacing,
matrix,
positioning}

\begin{document}
%\begin{sideways}
\begin{tikzpicture}[
node distance = 3ex,
*-*/.style = {{Circle[length=2pt]}-{Circle[length=2pt]},
shorten <=0.5ex, shorten >=0.5ex}
]
\matrix (ae) [inner sep=0pt,
matrix of math nodes,
nodes={text height=1.75ex, text depth=0.5ex,
inner sep=2pt, anchor=west},
column 4/.append style={anchor=center},
column 5/.append style={anchor=center},
column 6/.append style={nodes={anchor=east}},
column sep=0pt,
row sep=3pt,
nodes in empty cells,
left delimiter={[},
right delimiter={]}
]
{
x(0)    & 0         & 0         & \dotsm & \dotsm & 0               \\
x(1)    & x(0)      & 0         & \dotsm & \dotsm & 0               \\
x(2)    & x(1)      & x(0)      & \ddots &        & 0               \\
\vdots  & \vdots    & \vdots    &        & \ddots & \vdots          \\
x(p{-}1)& x(p{-}2)  & x(p{-}3)  & \dotsm & x(0)   & 0               \\
x(p)    & x(p-1)    & x(p{-}2)  & \dotsm & \dotsm & x(0)            \\
x(p{+}1)& x(p)      & x(p{-}1)  & \dotsm & \dotsm & x(1)            \\
\vdots  & \vdots    & \vdots    &        & \ddots & \vdots          \\
x(N{-}1)& x(N{-}2)  & x(N{-}3)  & \dotsm & \dotsm & x(N{-}1{-}p)    \\
0       & x(N{-}1)  & x(N{-}2)  & \dotsm & \dotsm & x(N{-}p)        \\
0       & 0         & x(N{-}1)  & \dotsm & \dotsm & x(N{-}p{+}1)    \\
\vdots  & \vdots    & \vdots    &        & \ddots & \vdots          \\
0       & 0         &   0       & \dotsm & \dotsm & x(N{-}1)\\
};
% vertical lines at the left side
\coordinate[left=1em of ae.west] (aux1); % ae.west is matrix ae west anchor
\draw[*-*]  (ae-1-1.north west -| aux1) -- node[left] {$p$}
(ae-4-1.south west -| aux1);
\draw[*-*]  (ae-7-1.north west -| aux1) -- node[left] {$N{-}p$}% node {$\approx$}
(ae-10-1.south west -| aux1);
\draw[*-*]  (ae-11-1.north west -| aux1) -- node[left] {$p$}
(ae-13-1.south west -| aux1);
\matrix (be) [right=of ae,
inner sep=0pt,
matrix of math nodes,
nodes={text height=1.75ex, text depth=0.5ex,
inner sep=2pt},
row sep=3pt,
nodes in empty cells,
left delimiter={[},
right delimiter={]}
]
{
1       \\
a_p(1)  \\
a_p(2)  \\
\vdots  \\
\vdots  \\
\vdots  \\
a_p(p)  \\
};
\matrix (ce) [right=of be,
inner sep=0pt,
matrix of math nodes,
nodes={text height=1.75ex, text depth=0.5ex,
inner sep=2pt},
row sep=3pt,
nodes in empty cells,
left delimiter={[},
right delimiter={]}
]
{
e(0)        \\
e(1)        \\
e(2)        \\
\vdots      \\
e(p{-}1)    \\
e(p)        \\
e(p{+}1)    \\
\vdots      \\
e(N{-}1)    \\
e(N)        \\
\vdots      \\
e(N{-}1{+}p)\\
};
% vertical lines at the right side
\coordinate[right=1em of ce.east] (aux1);%  ce.east is matrix ce east anchor
\draw[*-*]  (ce-7-1.north west -| aux1) -- node[right] {COVAR}
(ce-9-1.south west -| aux1);
\end{tikzpicture}
%\end{sideways}
\end{document}


You can also use a named local bounding box for a scope. I only changed some of the code. Frankly, I can't tell what you are trying to accomplish here.

\documentclass{article}
\usepackage{amsmath}
\usepackage[margin=0.5in]{geometry}
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{sideways}
\begin{tikzpicture}[
%%---------------------------------------
%%---------------------------------------
]
\matrix (ae) [matrix of nodes,
column 1/.style={anchor=west},
column 6/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
nodes in empty cells,
]
{
$x(0)$ &  $0$   & $0$ & $---$ & $---$  & $0$ \\
$x(1)$ & $x(0)$ & $0$ & $---$ & $---$  & $0$ \\
$x(2)$ & $x(1)$ & $x(0)$ &       &       & $|$ \\
$|$   &  $|$   &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$|$  &  $|$  &       &       &       & $|$\\
$x(p-1)$ & $x(p-2)$ & $x(p-3)$ & $---$ & $x(0)$& $0$\\
$x(p)$   & $x(p-1)$ & $x(p-2)$ & $---$ & $---$ & $x(0)$\\
$x(p+1)$ & $x(p)$   & $x(p-1)$ & $---$ & $---$ & $x(1)$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$|$ & $|$ & $|$ & & & $|$\\
$x(N-1)$ & $x(N-2)$ & $x(N-3)$ & $---$ & $---$ & $x(N-1-p)$\\
$0$ & $x(N-1)$ & $x(N-2)$ & $---$ & $---$ & $x(N-p)$\\
$0$ & $0$ & $x(N-1)$ & $---$ & $---$ & $x(N-p+1)$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$|$ & $|$ &   $|$    &       &       &   $|$\\
$0$ & $0$ &   $0$    & $---$ & $---$ & $x(N-1)$\\
};

% Vertical lines at the left corner
\draw[line width=0.6pt] ($(ae-1-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-7-1.south west)-(10ex,0)$) node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-10-1.west)-(10ex,0)$) node[] {\textbullet} -- ($(ae-12-1.south west)-(10ex,0)$)
node[left,xshift=-1mm] {$N - p$} node[yshift=-1mm] {$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(10ex,0)$) -- ($(ae-15-1.west)-(10ex,0)$)
node[] {\textbullet};
\draw[line width=0.6pt] ($(ae-16-1.west)-(10ex,0)$) node[] {\textbullet} -- node[left] {$p$}
($(ae-22-1.west)-(10ex,0)$) node[] {\textbullet};

% Left side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ++(5mm, 0);
\draw[line width=0.6pt] ($(ae-1-1.north west)-(6ex,0)$) -- ($(ae-12-1.south west)-(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-1.north west)-(6ex,0)$) -- ($(ae-22-1.south west)-(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-1.south west)-(6ex,0)$) -- ++(5mm, 0);

% Right side matrix delimiter
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ++(-5mm, 0);
\draw[line width=0.6pt] ($(ae-1-6.north east)+(6ex,0)$) -- ($(ae-12-6.south east)+(6ex,0)$) node[yshift=-1mm]{$\approx$};
\draw[line width=0.6pt] ($(ae-13-6.north east)+(6ex,0)$) -- ($(ae-22-6.south east)+(6ex,0)$);
\draw[line width=0.6pt] ($(ae-22-6.south east)+(6ex,0)$) -- ++(-5mm, 0);

\begin{scope}[xshift=7cm]
\matrix (be) [matrix of math nodes,
left delimiter={[},
right delimiter={]},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
1\\
a_p(1)\\
a_p(2)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
a_p(p)\\
};
\end{scope}

\begin{scope}[xshift = 9cm, right of=be,local bounding box=vector A]
\matrix (ce) [matrix of math nodes,
column 1/.style={anchor=west},
%column 1/.style={anchor=east},
minimum width=1cm,
column sep=0.3ex,
row sep=0.3ex,
inner sep=2.5pt,
ampersand replacement=\&]
{
e(0)\\
e(1)\\
e(2)\\
\mid\\
\mid\\
\mid\\
e(p - 1)\\
e(p)\\
\\
e(p + 1)\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1)\\
e(N)\\
\mid\\
\mid\\
\mid\\
\mid\\
\mid\\
e(N - 1 + p)\\
};
\end{scope}

% Left side delimiter
\draw[line width=0.6pt] (vector A.north west)++(5mm, 0) -- (vector A.north west)
-- (vector A.south west) node[yshift=-1mm, midway]{$\approx$} -- ++(5mm, 0);

% right side delimiter
\draw[line width=0.6pt] (vector A.north east)++(-5mm, 0) -- (vector A.north east)
-- (vector A.south east) node[yshift=-1mm, midway]{$\approx$} -- ++(-5mm, 0);

% Right side lines
\draw[line width=0.6pt] ($(ce-10-1.east)+(10ex,0)$) node[] {\textbullet} -- ($(ce-12-1.south east)+(10ex,0)$)
node[right,xshift=1mm] {COVAR} node[yshift=-1mm] {$\approx$};
\draw[line width=0.6pt] ($(ce-13-1.north east)+(10ex,0)$) -- ($(ce-15-1.east)+(10ex,0)$)
node[] {\textbullet};
\end{tikzpicture}
\end{sideways}
\end{document}