|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 mytomorrow 于 2020-1-10 10:12 编辑 p, A. B b4 y% `8 z
' V( v* Z9 V4 l/ t
8 u7 n8 z4 j( `pascal; l" E& B4 w% x& P7 q# d$ _
Pascal matrix
$ M7 h" w& x0 z4 @% g7 k
0 D7 F. {$ U. K6 T0 V
; }/ u* N: Z4 hSyntax2 I( V6 l* l0 `
! F. d4 c# V: b( UP = pascal(n)& R. |+ p- I e
4 E2 {, Y! J- _ K/ B6 LP = pascal(n,1)4 w$ b$ h9 P; @3 Z
; j9 {2 [ f( KP = pascal(n,2)# E& A2 M( C* t3 U* _* e$ ?! H4 w
/ y* c7 c* {0 n1 g- Y4 w. J
P = pascal(___,classname)! L' n/ T0 ?; `1 K4 f
0 I- e! d! T1 {8 I% }6 Q
. y) G4 k0 _' C9 z) Q6 O- Z, rDescription
+ |0 C. L* C& u5 @" \
: K+ a: ? F1 Q/ N! N) _P = pascal(n) returns a Pascal’s Matrix of order n. P is a symmetric positive definite matrix with integer entries taken from Pascal's triangle. The inverse of P has integer entries.# J* y8 {7 J) H# Q7 V
. p5 e! T6 _% ^P = pascal(n)返回阶数为n的Pascal矩阵。 P是对称正定矩阵,其整数条目取自Pascal的三角形。 P的倒数具有整数条目。/ |3 N0 i1 n M/ T2 G
$ Y" a$ ^0 B" x% t
P = pascal(n,1) returns the lower triangular Cholesky factor (up to the signs of the columns) of the Pascal matrix. P is involutary, that is, it is its own inverse./ m' [$ u- Z! t: ]0 R
0 j/ }. [& n; u S9 q/ h6 |P = pascal(n,1)返回Pascal矩阵的下三角Cholesky因子(直到列的符号)。 P是非自愿的,也就是说,它是它自己的逆。# f4 A8 X6 e5 a! A, q
7 E& ?- H Z. ?& j( ]P = pascal(n,2) returns a transposed and permuted version of pascal(n,1). In this case, P is a cube root of the identity matrix.2 ?5 |! s6 o7 B; j
8 s8 ]" S' s: Z3 bP = pascal(n,2)返回pascal(n,1)的转置和置换版本。 在这种情况下,P是单位矩阵的立方根。2 }; Z" L3 O& x
9 m- r. P! |4 p9 {8 Y
P = pascal(___,classname) returns a matrix of class classname using any of the input argument combinations in previous syntaxes. classname can be 'single' or 'double'.
! y. a/ }( ? _
s: \9 B/ D! D+ }* m/ ZP = pascal(___,classname)使用先前语法中的任何输入参数组合返回类classname的矩阵。 classname可以是'single'或'double'。
# v! [9 m- e& f$ ]' Z9 r3 q' r
9 ?, c* c' x6 @, R+ E
. X ^- V5 K# A5 u5 ?8 qMatrix from Pascal's Triangle
5 `* }& |* {6 r; L! Z6 Q$ @; F- @. ~
M% B" \+ o& m. dCompute the fourth-order Pascal matrix., ]- o4 i2 c0 m" N
3 H0 r$ B- ^3 j0 Y+ X* V, vA = pascal(4)
& `& `9 d. n6 o
: C- r. M- a% g! lA = 4×4
& R/ |; W/ H# c9 K. S& h
5 ~4 [% l! b, q. Q7 I9 ]% r$ D* c 1 1 1 1; H B$ y X; g; t
1 2 3 41 V$ F% H" i9 V' x+ @ K" v
1 3 6 10% ~0 P2 F* @: H6 l
1 4 10 20
( ^1 c) |" Q8 H# X! l) x U; d' b5 R! y0 q6 b. \* P
Compute the lower triangular Cholesky factor of the third-order Pascal matrix, and verify it is involutory.
1 d1 O% ~% m5 u% g
3 z3 h2 S$ m7 q& ~1 OA = pascal(3,1)2 |4 X) A3 y" R3 [! G0 i: i6 ?% I
/ f9 S) o1 J. Z% k& X
) n8 ]7 y' k; gA = 3×3
& y* V# Y: p: A) S, D# Z1 C
`; B# Q$ }! [ 1 0 0) l" S% Q9 a* c* X, K
1 -1 0
( @* M/ X/ A# F5 Z% l/ d 1 -2 19 e6 {$ ~/ [0 D. h
# b* O; @1 ^3 L) `" Cinv(A)
9 t" M: U: _# l; P
8 B& K. Y$ b7 b! j z5 H o% Vans = 3×3
* x a4 n6 I. M0 x6 ~9 m4 X
! Z; m y0 M9 e2 k, j 1 0 0
2 E& j# x' V7 e& r 1 -1 0$ g0 v5 I* I/ f0 | o! H( Y
1 -2 18 N* b4 l+ }' r3 h% J0 T
, Y0 _/ q0 a) j/ g) b
帕斯卡的矩阵
4 Q" r f1 [3 Y6 m/ ?, R' ?帕斯卡的三角形是由数字行组成的三角形。 第一行具有条目1.每个后续行通过添加前一行的相邻条目而形成,替换为0,其中不存在相邻条目。 pascal函数通过选择与指定矩阵维度相对应的Pascal三角形部分来形成Pascal矩阵,如图所示。 概述的矩阵对应于MATLAB®命令pascal(4)。+ q( i5 u8 M( Y4 O
. [; R; F% t, s) K
( L( u- D# |. R5 S* o3 A
! ]( E: I' C( f1 c9 H8 w4 ~
根据上述描述,我们猜测,pascal(3)为:4 {- F+ [/ x, T0 r4 e' Z* @: ?
4 X7 F, J: e: `! s' O- U/ A8 w; W1 1 1! \ {. [6 l2 M* S: `. J/ g$ i2 `
% R% H8 j% k3 E, j1 A
1 2 37 e4 y5 b9 M5 y% g0 U
/ U5 b: C( T" Y: f9 t
1 3 63 ]% v6 v4 {( i9 n. T P4 t
( |- H& z: A V% k5 Z3 H
验证下:
0 W% ]7 {- B1 s1 ?' C& W
! m ]) u) \. T# C3 i& w" H>> pascal(3)
2 ~% s6 [* Z2 r) K( ~! d9 _. U: ]5 d, `9 f8 o
ans =
6 ]6 v+ l; _2 X; V
4 z) E$ x* k$ b$ T8 n( ` 1 1 1/ ^2 i- X5 W# w1 m4 o; k/ ?
1 2 3
; t: U/ f5 v7 G% T8 s5 W; ] 1 3 6
" Y2 q2 i- q2 y9 w! H' e( y j" t. E Q( b2 l \3 R! X
确实如此!1 _. a8 l% P6 U2 Y; H2 D
; d- {+ X# C& W3 S
8 Z* {+ A# `, E% j7 ` |
|