日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab的数值计算功能,MATlAB数值计算功能

發(fā)布時(shí)間:2025/3/15 循环神经网络 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab的数值计算功能,MATlAB数值计算功能 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

三. 逆矩陣及行列式(Revers and determinant of matrix)

1. 方陣的逆和行列式(Revers and determinant of square matrix)

若a是方陣,且為非奇異陣,則方程ax=I和 xa=I有相同的解X。X稱為a的逆矩陣,記做a-1,在MATLAB中用inv 函數(shù)來(lái)計(jì)算矩陣的逆。計(jì)算方陣的行列式則用det函數(shù)。

DET? ??Determinant.

DET(X) is the determinant of the square matrix X.

Use COND instead of DET to test for matrix singularity.

INV ???Matrix inverse.

INV(X) is the inverse of the square matrix X. A warning message is printed if X is badly scaled or nearly singular.

例:計(jì)算方陣的行列式和逆矩陣。

a=[3? -3? 1;-3? 5? -2;1? -2? 1];

b=[14? 13? 5; 5? 1? 12;6? 14? 5];

d1=det(a)

x1=inv(a)

d2=det(b)

x2=inv(b)

d1 =

1

x1 =

1.0000??? 1.0000??? 1.0000

1.0000??? 2.0000??? 3.0000

1.0000??? 3.0000??? 6.0000

d2 =

-1351

x2 =

0.1207?? -0.0037?? -0.1118

-0.0348?? -0.0296??? 0.1058

-0.0474??? 0.0873?? ?0.0377

2. 廣義逆矩陣(偽逆)(Generalized inverse matrix)

一般非方陣無(wú)逆矩陣和行列式,方程ax=I 和xa=I至少有一個(gè)無(wú)解,這種矩陣可以求得特殊的逆矩陣,成為廣義逆矩陣(generalized inverse matrix)(或偽逆 pseudoinverse)。矩陣amn存在廣義逆矩陣xnm,使得 ax=Imn, MATLAB用pinv函數(shù)來(lái)計(jì)算廣義逆矩陣。

例:計(jì)算廣義逆矩陣。

a=[8? 14; 1? 3; 9? 6]

x=pinv(a)

b=x*a

c=a*x

d=c*a ????%d=a*x*a=a

e=x*c???? %e=x*a*x=x

a =

8??? 14

1???? 3

9???? 6

x =

-0.0661?? -0.0402??? 0.1743

0.1045??? 0.0406?? -0.0974

b =

1.0000?? -0.0000

-0.0000??? 1.0000

c =

0.9334??? 0.2472??? 0.0317

0.2472??? 0.0817?? -0.1177

0.0317?? -0.1177??? 0.9849

d =

8.0000?? 14.0000

1.0000??? 3.0000

9.0000??? 6.0000

e =

-0.0661?? -0.0402??? 0.1743

0.1045??? 0.0406?? -0.0974

PINV ??Pseudoinverse.

X = PINV(A) produces a matrix X of the same dimensions as A' so that A*X*A = A, X*A*X = X and A*X and X*A are Hermitian. The computation is based on SVD(A) and any singular values less than a tolerance are treated as zero.

The default tolerance is MAX(SIZE(A)) * NORM(A) * EPS.

PINV(A,TOL) uses the tolerance TOL instead of the default.

四. 矩陣分解(Matrix decomposition)

MATLAB求解線性方程的過(guò)程基于三種分解法則:

(1)Cholesky分解,針對(duì)對(duì)稱正定矩陣;

(2)高斯消元法,? 針對(duì)一般矩陣;

(3)正交化,?? ???針對(duì)一般矩陣(行數(shù)≠列數(shù))

這三種分解運(yùn)算分別由chol, lu和 qr三個(gè)函數(shù)來(lái)分解.

1.???????? Cholesky分解(Cholesky Decomposition)

僅適用于對(duì)稱和上三角矩陣

例:cholesky分解。

a=pascal(6)

b=chol(a)

a =

1???? 1???? 1???? 1???? 1???? 1

1???? 2???? 3???? 4???? 5???? 6

1???? 3???? 6??? 10??? 15??? 21

1???? 4??? 10??? 20??? 35??? 56

1???? 5??? 15??? 35??? 70?? 126

1???? 6??? 21??? 56?? 126?? 252

b =

1???? 1???? 1???? 1???? 1???? 1

0???? 1???? 2???? 3???? 4???? 5

0???? 0???? 1???? 3???? 6??? 10

0???? 0???? 0???? 1???? 4??? 10

0???? 0???? 0???? 0???? 1???? 5

0???? 0???? 0???? 0???? 0???? 1

CHOL? ?Cholesky factorization.

CHOL(X) uses only the diagonal and upper triangle of X. The lower triangular is assumed to be the (complex conjugate) transpose of the upper.? If X is positive definite, then R = CHOL(X) produces an upper triangular R so that R'*R = X. If X is not positive definite, an error message is printed.

[R,p] = CHOL(X), with two output arguments, never produces an

error message.? If X is positive definite, then p is 0 and R is the same as above.?? But if X is not positive definite, then p is a positive integer.

When X is full, R is an upper triangular matrix of order q = p-1

so that R'*R = X(1:q,1:q). When X is sparse, R is an upper triangular matrix of size q-by-n so that the L-shaped region of the first q rows and first q columns of R'*R agree with those of X.

2. LU分解(LU factorization).

用lu函數(shù)完成LU分解,將矩陣分解為上、下兩個(gè)三角陣,其調(diào)用格式為:

[l,u]=lu(a) ?l代表下三角陣,u代表上三角陣。

例:

LU分解。

a=[47? 24? 22; 11? 44? 0;30? 38? 41]

[l,u]=lu(a)

a =

47??? 24??? 22

11??? 44???? 0

30??? 38??? 41

l =

1.0000???????? 0???????? 0

0.2340??? 1.0000???????? 0

0.6383??? 0.5909? ??1.0000

u =

47.0000?? 24.0000?? 22.0000

0?? 38.3830?? -5.1489

0???????? 0?? 30.0000

LU ????LU factorization.

[L,U] = LU(X) stores an upper triangular matrix in U and a "psychologically lower triangular matrix" (i.e. a product of lower triangular and permutation matrices) in L, so that X = L*U. X can be rectangular.

[L,U,P] = LU(X) returns unit lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that? P*X = L*U.

3. QR分解(Orthogonal-triangular decomposition).

函數(shù)調(diào)用格式:[q,r]=qr(a), q代表正規(guī)正交矩陣,r代表三角形矩陣。原始陣a不必一定是方陣。如果矩陣a是m×n階的,則矩陣q是m×m階的,矩陣r是m×n階的。

例:QR分解.

A=[22? 46? 20? 20; 30? 36? 46? 44;39? 8? 45? 2];

[q,r]=qr(A)

q =

-0.4082?? -0.7209?? -0.5601

-0.5566?? -0.2898??? 0.7786

-0.7236??? 0.6296?? -0.2829

r =

-53.8981? -44.6027? -66.3289? -34.1014

0? -38.5564??? 0.5823? -25.9097

0???????? 0?? 11.8800?? 22.4896

QR ????Orthogonal-triangular decomposition.

[Q,R] = QR(A) produces an upper triangular matrix R of the same

dimension as A and a unitary matrix Q so that A = Q*R.

[Q,R,E] = QR(A) produces a permutation matrix E, an upper

triangular R and a unitary Q so that A*E = Q*R.? The column

permutation E is chosen so that abs(diag(R)) is decreasing.

[Q,R] = QR(A,0) produces the "economy size" decomposition. If A is m-by-n with m > n, then only the first n columns of Q are computed.

4. 特征值與特征矢量(Eigenvalues and eigenvectors).

MATLAB中使用函數(shù)eig計(jì)算特征值和 特征矢量,有兩種調(diào)用方法:

*e=eig(a), 其中e是包含特征值的矢量;

*[v,d]=eig(a), 其中v是一個(gè)與a相同的n×n階矩陣,它的每一列是矩陣a的一個(gè)特征值所對(duì)應(yīng)的特征矢量,d為對(duì)角陣,其對(duì)角元素即為矩陣a的特征值。

例:計(jì)算特征值和特征矢量。

a=[34? 25? 15; 18? 35? 9; 41? 21? 9]

e=eig(a)

[v,d]=eig(a)

a =

34??? 25??? 15

18??? 35???? 9

41??? 21???? 9

e =

68.5066

15.5122

-6.0187

v =

-0.6227?? -0.4409?? -0.3105

-0.4969??? 0.6786?? -0.0717

-0.6044?? -0.5875??? 0.9479

d =

68.5066???????? 0???????? 0

0?? 15.5122???????? 0

0???????? 0?? -6.0187

EIG? ??Eigenvalues and eigenvectors.

E = EIG(X) is a vector containing the eigenvalues of a square matrix X.

[V,D] = EIG(X) produces a diagonal matrix D of eigenvalues and a full matrix V whose columns are the corresponding eigenvectors so that X*V = V*D.

[V,D] = EIG(X,'nobalance') performs the computation with balancing

disabled, which sometimes gives more accurate results for certain

problems with unusual scaling. If X is symmetric, EIG(X,'nobalance')

is ignored since X is already balanced.

5. 奇異值分解.( Singular value decomposition).

如存在兩個(gè)矢量u,v及一常數(shù)c,使得矩陣A滿足:Av=cu,? A’u=cv

稱c為奇異值,稱u,v為奇異矢量。

將奇異值寫(xiě)成對(duì)角方陣∑,而相對(duì)應(yīng)的奇異矢量作為列矢量則可寫(xiě)成兩個(gè)正交矩陣U,V,使得: AV=U∑, A‘U=V∑? 因?yàn)閁,V正交,所以可得奇異值表達(dá)式:

A=U∑V’。

一個(gè)m行n列的矩陣A經(jīng)奇異值分解,可求得m行m列的U, m行n列的矩陣∑和n行n列的矩陣V.。

奇異值分解用svd函數(shù)實(shí)現(xiàn),調(diào)用格式為;

[u,s,v]=svd(a)

SVD??? Singular value decomposition.

[U,S,V] = SVD(X) produces a diagonal matrix S, of the same dimension as X and with nonnegative diagonal elements in decreasing order, and unitary matrices U and V so that X = U*S*V'.

S = SVD(X) returns a vector containing the singular values.

[U,S,V] = SVD(X,0) produces the "economy size" decomposition. If X is m-by-n with m > n, then only the first n columns of U are computed and S is n-by-n.

例: 奇異值分解。

a=[8? 5; 7? 3;4? 6];

[u,s,v]=svd(a) ????????????% s為奇異值對(duì)角方陣

u =

-0.6841?? -0.1826?? -0.7061

-0.5407?? -0.5228??? 0.6591

-0.4895??? 0.8327??? 0.2589

s =

13.7649???????? 0

0??? 3.0865

0???????? 0

v =

-0.8148?? -0.5797

-0.5797??? 0.8148

總結(jié)

以上是生活随笔為你收集整理的matlab的数值计算功能,MATlAB数值计算功能的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲欧洲国产精品 | 少妇高潮一区二区三区 | 精品无码人妻少妇久久久久久 | 日韩成人一区二区三区 | 亚洲free性xxxx护士白浆 | www.youjizz日本 | 婷婷综合激情网 | 毛片传媒| 免费性情网站 | 国产女主播喷水高潮网红在线 | 黄色在线观看网址 | 亚洲破处视频 | 天天看片天天干 | 激情五月激情综合网 | 六月丁香久久 | 久久五月视频 | 国产精品入口a级 | 一级黄色裸体片 | 一级片国产 | 激情久久婷婷 | 特黄视频在线观看 | 四虎永久在线精品免费网址 | 波多野吉衣伦理片 | 九九热视频精品在线观看 | 一区二区三区不卡视频 | 欧美激情精品久久久久久免费 | 精品乱子伦一区二区三区 | 亚洲一区精品在线观看 | 亚洲天堂中文字幕在线观看 | 精品国产亚洲一区二区麻豆 | xxx综合网| 国产第八页 | 中文字幕蜜臀 | 加勒比视频在线观看 | 窝窝午夜视频 | 国产主播精品在线 | 久操视频免费看 | 欧美 日韩 视频 | 久久精品久久精品 | 一区二区三区不卡视频 | 欧美黄色性视频 | 操操操网站 | www.超碰在线.com | 日韩精品国产精品 | 青娱乐97 | 精品毛片在线观看 | 欧美一区二区久久 | 亚洲综合精品在线 | 一区二区三区韩国 | 国产99色| 超清av在线 | 伊人蕉久影院 | 欧美精品一区二区成人 | 欧美另类极品videosbest使用方法 | 91国在线 | 自拍偷自拍亚洲精品播放 | 午夜男人天堂 | 日韩精品免费在线观看 | 久久sp| 91亚洲一区二区三区 | 亚洲国产精选 | 熟女人妻aⅴ一区二区三区60路 | 亚洲精品性视频 | 久久蜜桃av一区二区天堂 | 久久久久久久女国产乱让韩 | 色呦呦影院 | 日韩精品一二三 | 肥熟女一区二区三肥熟女 | 中文字幕视频在线播放 | 国产乡下妇女做爰视频 | 第四色男人天堂 | 曰本毛片 | 久久cao | 日本成人精品 | 啪啪综合| 少妇人妻偷人精品无码视频 | 国产精品视频网站 | 国产精品白丝喷水在线观看 | 亚洲欧美一二三 | 久久精品2 | 丰满少妇在线观看资源站 | 中国女人一级片 | 久草aⅴ | 涩涩涩涩涩涩涩涩涩涩 | 岛国av免费在线 | www.av小说 | 插插宗合网 | 精品视频久久久久久 | 成人精品二区 | 国内自拍视频网站 | 中国少妇高潮 | 国产一级片播放 | 淫羞阁av导航 | 特黄做受又粗又大又硬老头 | 日本丰满熟妇hd | 深夜的私人秘书 | 国产主播精品 | 丁香亚洲| 毛片在线免费观看网址 |