MATLAB 中的埃切朗形式

Ammar Ali 2021年11月29日 MATLAB MATLAB Matrix
MATLAB 中的埃切朗形式

本教程将讨论使用 Matlab 中的 rref() 函数查找矩阵的缩减行梯形形式。

使用 MATLAB 中的 rref() 函数查找矩阵的减行埃切朗形式

缩小的行埃切朗形式是用来解决使用 Matlab 的线性方程组。缩减行埃切朗形式意味着高斯消除法已经对行进行了操作。你可以使用 Matlab 的内置函数 rref() 来找到一个矩阵的减行埃切朗形式。例如,让我们使用 magic() 函数创建一个矩阵,并使用 Matlab 中的函数找到其缩小的行埃切朗形式。请看下面的代码。

MyMatrix = magic(6)
RREF = rref(MyMatrix)

输出:

MyMatrix =

    35     1     6    26    19    24
     3    32     7    21    23    25
    31     9     2    22    27    20
     8    28    33    17    10    15
    30     5    34    12    14    16
     4    36    29    13    18    11


RREF =

     1     0     0     0     0    -2
     0     1     0     0     0    -2
     0     0     1     0     0     1
     0     0     0     1     0     2
     0     0     0     0     1     2
     0     0     0     0     0     0

我们还可以添加支点公差,这将被用来寻找减行埃切朗形式。如果我们添加另一个参数作为输出,我们也可以找到非零的枢轴和减少的行埃切朗形式。例如,让我们使用 Matlab 中的函数 rref() 来寻找上述矩阵的非零支点。请看下面的代码。

MyMatrix = magic(6)
[RREF,P] = rref(MyMatrix)

输出:

MyMatrix =

    35     1     6    26    19    24
     3    32     7    21    23    25
    31     9     2    22    27    20
     8    28    33    17    10    15
    30     5    34    12    14    16
     4    36    29    13    18    11


RREF =

     1     0     0     0     0    -2
     0     1     0     0     0    -2
     0     0     1     0     0     1
     0     0     0     1     0     2
     0     0     0     0     1     2
     0     0     0     0     0     0
     
P =

     1     2     3     4     5

正如你在上面的输出中看到的,rref() 函数也生成了非零枢轴。

Enjoying our tutorials? Subscribe to DelftStack on YouTube to support us in creating more high-quality video guides. Subscribe
作者: Ammar Ali
Ammar Ali avatar Ammar Ali avatar

Hello! I am Ammar Ali, a programmer here to learn from experience, people, and docs, and create interesting and useful programming content. I mostly create content about Python, Matlab, and Microcontrollers like Arduino and PIC.

LinkedIn Facebook

相关文章 - MATLAB Matrix