matlab如何求矩阵特征值?vb怎样求一个矩阵的最大特征值?

来源:科技时报网 | 时间:2023-06-02 10:12:55

matlab如何求矩阵特征值?

01

首先我们打开matlab软件,定义一个矩阵,

02

然后执行[x,y] = eig(a)公式,求出x,y的值,

03

接下来执行diag(y),求出y的特征值,

04

最后矩阵的特征值都标示在红框中了

vb怎样求一个矩阵的最大特征值?

Private Sub ni_Click()

End Sub

Public Function GetHLS(A() As Integer) As Double

If UBound(A) = 1 Then

GetHLS = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0)

End If

If UBound(A) > 1 Then

Dim RRes As Double

Dim LRes As Double

Dim CNum As Integer

Dim TNum As Double

Dim i As Integer

RRes = 0

LRes = 0

For i = 0 To UBound(A)

CNum = i

TNum = 1、If i = 0 Then

For j = 0 To UBound(A)

TNum = TNum * A(j, j)

Next j

End If

If i > 0 Then

Call YD(i)

For j = 0 To UBound(A)

TNum = TNum * A(j, cc(j))

Next j

End If

RRes = RRes + TNum

Next i

For i = 0 To UBound(A)

CNum = i

TNum = 1、If i = 0 Then

For j = 0 To UBound(A)

TNum = TNum * A(j, UBound(A) - j)

Next j

End If

If i > 0 Then

Call YD(i)

For j = 0 To UBound(A)

TNum = TNum * A(UBound(A) - j, cc(j))

Next j

End If

LRes = LRes + TNum

Next i

GetHLS = RRes - LRes

End If

End Function

Public Sub YD(N As Integer)

Dim n1 As Integer

n1 = UBound(aa)

ReDim bb(n1)

ReDim cc(n1)

For i = 0 To n1 - N

bb(i) = aa(N + i)

Next

For i = 0 To n1 - N

cc(i) = bb(i)

Next

For i = n1 - N + 1 To n1、cc(i) = aa(i - n1 + N - 1)

Next

End Sub

2 STM power fail 5V 电源电压低于 2.5V 系统失电期间系统停机

业界
移动互联网

©2003-2020 CMS科技网 版权所有       联系邮箱:51 46 76 11 3 @qq.com   浙ICP备2022016517号-14