freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

探討如何解線性代數(shù)中線性方程式求解以及求eigenva-資料下載頁

2024-10-04 15:10本頁面
  

【正文】 1000),1000,1000)。a=a+offdiag+offdiag39。% generate full matrixb=full(a)。% generate arbitrary right hand side for system of equationsrhs=[1:1000]39。tic。 x=a\rhs。 t1=toc。tic。 x=b\rhs。 t2=toc。fprintf(39。Time for sparse matrix solve = %\n39。, t1)。fprintf(39。Time for full matrix solve = %\n39。, t2)。過程中的,最後a=。最後得到 t1 = ,t2 = (不是固定的值),兩者差異很大 (sparse節(jié)省很多運(yùn)算)。(5) sprandn:產(chǎn)生常態(tài)亂數(shù)sparse矩陣, sprandsym:產(chǎn)生常態(tài)亂數(shù)sparse對(duì)稱矩陣 a = sprandn(m,n,d) 其中參數(shù)表示矩陣為m180。n,d為非零元素所佔(zhàn)百分比。 a = sprandsym(n,d) 少一個(gè)參數(shù)因?qū)ΨQ矩陣必是square。Example 3: a = sprandn(5, 5, )a = (3,1) (3,2) (5,4) (2,5) (3,5) b=full(a)b = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 as=sprandsym(5, )as = (3,1) (4,1) (2,2) (1,3) (4,3) (1,4) (3,4) full(as)ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0sprandsym的另一種用法: a = sprandsym(n, density, r)若r是純量則產(chǎn)生一個(gè)條件數(shù)為1/r的亂數(shù)稀疏對(duì)稱矩陣,若r是長(zhǎng)度為n的向量則產(chǎn)生一個(gè)特徵值(eigenvalie)是r中元素的亂數(shù)稀疏對(duì)稱矩陣。正定矩陣的特徵值皆為正數(shù),故若r的每一個(gè)元素都是正數(shù),則會(huì)產(chǎn)生正定矩陣。Example 4: aposdef = sprandsym(6, , [1 6 9 2 ])aposdef = (1,1) (5,1) (6,1) (2,2) (4,2) (3,3) (2,4) (4,4) (1,5) (5,5) (6,5) (1,6) (5,6) (6,6) posdeful=full(aposdef)posdeful = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 這是產(chǎn)生具有特定所需性質(zhì)之測(cè)試矩陣的重要方法?!?隨堂練習(xí):()使用函數(shù)sprandsym(500, , r) 180。500正定稀疏矩陣,由取r = 3:2:1001這矩陣將是正定。用tic及toc求這矩陣做柯列斯基分解所需的計(jì)算時(shí)間。轉(zhuǎn)稀疏矩陣為滿矩陣並重覆程式試驗(yàn)。,何種矩陣所需計(jì)算時(shí)間較多?167。 The Eigenvalue Problem Def. Ax=lx, where A : n180。n matrix, l : scalar, x : n180。1 column vector, l is an eigenvalue of A, and x is an eigenvector of A corresponding to l.※ 如何求l及x :(AlI)x = 0 222。 | AlI | = 0 222。 l是n階特徵多項(xiàng)式 (characteristic polynomial) 的根 222。 在MATLAB 可用 “poly” 產(chǎn)生特徵方程式係數(shù),再用 “roots” 求根Example: p = poly(A)p = 1 15 18 360 % 表示特徵方程式為 roots(p)ans = ※ 用 “eig” 可直接求eigenvalues: eig(A)ans = ※ 隨堂練習(xí):,。 167。 The MATLAB Function eig※ Syntax (語法):d = eig(A) % 產(chǎn)生A的eigenvalues (d是vector) d = eig(A,B) % 解Ax = lBx (generalized eigenvalue problem), A,B : n180。n[V,D] = eig(A) % V : 每個(gè)column是一個(gè)eigenvector, D : diagonal上是eigenvalues , A xi = li xi,A*V = V*D。Example: () Find the eigenvalues and the eigenvectors using the MATLAB function eig for the matrix Sol. [V, D] = eig(A)V = + 0 + 0 D = 2+4i 0 0x3x2x1 0 24i 0 0 0 1※ 隨堂練習(xí):,矩陣需更正為 ,公式需更正為。 167。 補(bǔ)充(1) Find the reduced row echelon form of A rref(A)ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1(2) What is the rank of A? rank(A) ans = 4(3) What is the determinant of A? det(A) ans = 90(4) Is A a singular matrix? No. (因det(A)185。0)(5) What is the trace of A? trace(A) ans = 7(6) Find the inverse of A if it exists. inv(A) ans = 0 (7) Is A a triangular matrix? No.(8) What is the 2norm of b? norm(b) ans = (9) What is the condition number of A? cond(A) ans = (10) Solve the system of linear equations Ax = b. If x is your answer, what’s the norm of Axb? x = A\b ans = norm(A*xb) ans = (11) Find the LU deposition of the matrix A with a true lower triangular matrix L. [L, U, P] = lu(A) L = 1 0 0 0 1 0 0 1 0 1 U = 5 2 1 2 0 0 0 0 0 0 P = 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 0(12) Find the eigenvalues and eigenvectors of A. [ V, D] = eig(A)(13) Is A a positive definite matrix? No. (因eigenvalue of A 沒有全大於0,或因p=chol(A) 指令出現(xiàn)錯(cuò)誤訊息)(14) Find the eigenvalues of AHA. eig (A’*A) ans = (15) Find the Cholesky deposition of AHA. P = chol(A’*A)(16) Find the QR deposition of A. [Q, R] = qr(A)(17) Let C = A \ 4th row. Find the QR deposition of C. C = A(1:3, :) [Q2, R2] = qr(C)(18) Find the singular value deposition of A. [U, S, V] = svd(A)(19) What is the smallest singular value of A? ans =
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1