Abstract: Let SLAut(F<em>q<sup>n) denote the group of all semilinear isometries on F</em>q<sup>n, where q=p<sup>e is a prime power. Matrix-product (MP) codes are a class of long classical codes generated by combining several commensurate classical codes with a defining matrix. We give an explicit formula for calculating the dimension of the σ hull of a MP code. As a result, we give necessary and sufficient conditions for the MP codes to be σ dual-containing and σ self-orthogonal. We prove that dim<em>F</em>q(Hull<em>σ(C))=dim</em>F<em>q(Hull</em>σ(C<sup>⊥σ)). We prove that for any integer h with max0,k1−k2≤h≤dim<em>F</em>q(C<em>1∩C</em>2<sup>⊥σ), there exists a linear code C<em>2,h monomially equivalent to C</em>2 such that dim<em>F</em>q(C<em>1∩C</em>2,h<sup>⊥σ)=h, where C<em>i is an [n,k</em>i]<em>q linear code for i=1,2. We show that given an [n,k,d]</em>q linear code C, there exists a monomially equivalent [n,k,d]<em>q linear code C</em>h, whose σ dual code has minimum distance $d'$, such that there exist an [[n,k−h,d;n−k−h]]<em>q EAQECC and an $[[n,n-k-h,d';k-h]]</em>{q}$ EAQECC for every integer h with 0≤h≤dim<em>F</em>q(Hullσ(C)). Based on this result, we present a general construction method for deriving EAQECCs with flexible parameters from MP codes related to σ hulls.