This seems to do what you want:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand{\Inxy}[4]{%
\mathbb{I}_{#1}%
\sbox0{$\displaystyle\left({#2}\bigg|\right)$}% at least \bigg
\left(
#2\vphantom{\usebox0}%
\;\middle|\;
\smash{\vcenter to \dimexpr\ht0+\dp0{
\hbox{\strut$\displaystyle#3$}
\vfill
\hbox{\strut$\displaystyle#4$}
}}%
\right)
}
\begin{document}
\begin{equation}
\Inxy{N}{\begin{bmatrix}
p_1 & \dots & p_N \\
a_1 & \dots & a_n \\
b_1 & \dots & b_n \\
\end{bmatrix}\!}{x}{y}
\end{equation}
\begin{equation}
\Inxy{N}{\begin{bmatrix}a\\b\end{bmatrix}\!}{x}{y}
\end{equation}
\begin{equation}
\Inxy{N}{A}{B}{C}
\end{equation}
\end{document}

A more complete solution where the two indices (third and fourth arguments) are typeset in script style if the macro appears in text style (like for fractions).
In the example I use center just to place the final example aligned with the others.
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
\newcommand{\Inxy}[4]{{%
\mathpalette\Inxy@aux@i{{#1}{#2}{#3}{#4}}%
}}
\newcommand{\Inxy@aux@i}[2]{\Inxy@aux@ii{#1}#2}
\newcommand{\Inxy@aux@ii}[5]{%
\mathbb{I}_{#2}%
\sbox\z@{$\m@th#1\left({#3}\right)$}%
\sbox\tw@{\vbox{\hbox{$\Inxy@demote#1\mathstrut#4$}\hbox{$#1\mathstrut#5$}}}%
\left(
#3\vphantom{\usebox\z@\vcenter{\copy\tw@}}%
\;\middle|\;
\dimen@=\ht\z@ \advance\dimen@\dp\z@
\ifdim\ht\tw@>\dimen@ \dimen@=\ht\tw@ \fi
\smash{\vcenter to \dimen@{
\hbox{$\m@th\Inxy@demote#1\mathstrut#4$}
\vfill
\hbox{$\m@th\Inxy@demote#1\mathstrut#5$}
}}%
\right)
}
\newcommand\Inxy@demote[1]{%
\ifx\displaystyle#1\displaystyle\else
\ifx\textstyle#1\scriptstyle\else
\scriptscriptstyle
\fi\fi
}
\makeatother
\begin{document}
\begin{equation}
\Inxy{N}{\begin{bmatrix}
p_1 & \dots & p_N \\
a_1 & \dots & a_n \\
b_1 & \dots & b_n \\
\end{bmatrix}\!}{x}{y}
\end{equation}
\begin{equation}
\Inxy{N}{\begin{bmatrix}a\\b\end{bmatrix}\!}{x}{y}
\end{equation}
\begin{equation}
\Inxy{N}{A}{B}{C}
\end{equation}
\begin{center}
$\Inxy{N}{\begin{smallmatrix} 1 & 2 \\ 1 & 2 \\ 1 & 2 \end{smallmatrix}}{x}{y}$
\end{center}
\end{document}

\documentclass{...}amd ending with\end{document}. – Zarko Jul 22 '17 at 18:28