This instruction set explains how to solve a matrix equation and perform statistical analysis on a matrix in MATLAB.

  • The matrix equations will be in the form Ax=B.
  • The statistical analysis will find the total number of data points as well as the minimum, maximum, and range. In addition, it will include the sum, mean, and standard deviation. This section can be used on its own (without Part 1).
  • For those with experience in MATLAB programming, the bold print offers an overview of each step.
  • For new and less confident MATLAB users, the non-bolded text will offer a more detailed description of each step.
  • The italicized text in each step offers an example of the step; it is suggested that those unfamiliar with programming make use of these examples to compare with what they have typed.
Part 1
Part 1 of 2:

Solving the Matrix Equation

  1. 1
    Standardize your matrices to be usable in the standard form of a matrix equation, Ax = B.
    • For this instruction set, the matrix equation [1 2 -2 ; 2 3 1 ; 3 2 -4] x = [9 ; 23 ; 11] will be used to illustrate the process of solving the equation.
    • The matrix [1 2 -2 ; 2 3 1 ; 3 2 -4] is the coefficient matrix.
    • The B matrix is [ 9 ; 23 ; 11].
    • The variable x is the matrix of solutions to the equation.
  2. 2
    Create the A matrix.
    Advertisement
  3. 3
    Create the B matrix.
  4. 4
    Check to see if the matrices are compatible for solving matrix equations. Do this by storing the size of each matrix as a variable and checking to see if there are the same number of columns in A as there rows in B.
  5. 5
  6. Advertisement
Part 2
Part 2 of 2:

Performing Statistical Analysis

  1. 1
    Create the A matrix as a single row matrix.
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
    Create a table to display the statistical analysis using the built-in function 'table'.
  10. Advertisement

Warnings

  • Variable names are case sensitive and cannot contain any special characters, such as $,3,@,!, etc.
    ⧼thumbs_response⧽
Advertisement

References

  1. The screenshots included are from the 'R2016b' student download of MATLAB.

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 26,186 times.
How helpful is this?
Co-authors: 5
Updated: July 28, 2022
Views: 26,186
Categories: MATLAB
Advertisement