How to Find Minor Matrices in MATLAB
By Michael Peter
Typical MATLAB science and engineering software applications include data processing and analysis where built-in matrix operations, including addition and multiplication, manipulate data. MATLAB’s plotting functions then visualize the data. Removing a row and column from a matrix and taking the determinant of the smaller matrix produces row and column minors, which calculate the matrix cofactor. MATLAB doesn't include a built-in function capable of taking the minor of a matrix, however knowing other matrix manipulation techniques makes it possible to calculate the minor with the software.
Step 1
Clear all active variables within the workspace; enter clear all in the MATLAB command window.
Step 2
Create a sample square matrix. Input x=rand(3,3) into the command window. This creates a 3 by 3 row/column matrix of random numbers.
Step 3
Take the minor Mrc of the matrix created earlier by omitting the elements in the row, r, and column, c, of the minor and then take the determinant of the resulting matrix. To find the minor M23 input x(2,:)=[] followed by x(:,3)"=[]. The first command deletes the second row from the matrix "x." The second command deletes the third column from the matrix "x". The sample matrix has now transformed from a 3 x 3 to a 2 x 2 matrix.
Step 4
Take the determinant of the modified matrix. Input det(x) in the command window to output the minor M23 of matrix "x."
References
Tips
- Taking the determinant requires a square matrix; therefore the initial matrix must be square.
Writer Bio
Michael Peter has been a technical writer since 2006 for a power/start-up company and has published scientific papers in research journals including "Analytical Chemistry" and "Electrochimica Acta." He holds a Bachelor of Science in mechanical engineering and is currently completing his Ph.D. related to nano/microfludics and spectroscopy.