Consider the given two matrices,
$\left[ \begin{matrix}
3p-q \\
7 \\
\end{matrix} \right]=\left[ \begin{matrix}
7 \\
p+q \\
\end{matrix} \right]$
Given two matrices pre rectangular matrices of .
$3p–q=7$ … (i)
$p+q=5$ … (ii)
$p=5–q$
Substitute the value of p in equation (i),
$3(5–q)–q=7$
$15–3q–q=7$
$15-4q=7$
$15–7=4q$
$8=4q$
$q=8/4$
$q=2$
Then, $p+q=5$
$p=5–q$
$p=5–2$
$p=3$
Therefore, the value of p is $3$ and q is $2$.