找回密码
 注册
关于网站域名变更的通知
查看: 563|回复: 1
打印 上一主题 下一主题

MATLAB的Pascal matrix 简单介绍

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-1-10 10:01 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
本帖最后由 mytomorrow 于 2020-1-10 10:12 编辑
# j+ r2 {9 C( s" J% c3 p# ^
- H0 I% y2 ^0 C  P3 n* W! B2 |6 ?, t2 b4 D! [8 [
pascal" u' b2 J: E" P0 E
Pascal matrix% i! ^. X  Q9 H: T0 v) K
/ {3 {6 R, m. N7 ?2 o0 r: L

5 x5 @& Y" h8 d$ C' A+ \- ?Syntax
5 T1 [3 H. R. U$ l3 y5 P' `; J! u5 G# `* `
P = pascal(n)
6 j. J3 m: ^4 R6 C, d: C" I( `6 g
9 n- @" O; [3 T# mP = pascal(n,1)$ M9 O: `* j' d* N+ _( l
3 s! a0 S/ n# V  n' H
P = pascal(n,2)
( e! y1 t2 ]& C+ K" K4 N( E* L. |0 a
P = pascal(___,classname)  N6 {2 K" E* D! {( ]) K4 _

/ R2 Y+ o0 \; g
- O" l/ ]" M8 F. q6 g5 R! g- e# {( WDescription4 S; D4 M+ x1 [* @- K, ]. I/ n* ]  M
0 r% @, y2 N& l9 _
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.# ^0 q/ I. f. p+ K, a
1 g! ~3 K5 e( a# S
P = pascal(n)返回阶数为n的Pascal矩阵。 P是对称正定矩阵,其整数条目取自Pascal的三角形。 P的倒数具有整数条目。7 |: f! ~5 x6 a: l

: E1 Y9 F/ l; `& L; V1 z$ JP = 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." Y; v- _; Q8 |. `& A, N% ?' ~: z

% i6 A$ Q5 y( J5 _1 n) H5 |8 w5 EP = pascal(n,1)返回Pascal矩阵的下三角Cholesky因子(直到列的符号)。 P是非自愿的,也就是说,它是它自己的逆。
0 K; R# t- [0 [
4 |9 ]$ A# `! A' C& JP = 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.  Z3 ]: l, x" {( K- y' c3 s6 r
. N& W: ~8 ]( @( V7 t' K1 A" u: d! ?
P = pascal(n,2)返回pascal(n,1)的转置和置换版本。 在这种情况下,P是单位矩阵的立方根。
7 z  h( D, e6 \0 k# j( B% o0 ?6 l9 L$ W# P
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'.
) m) L6 G; k0 n3 [5 R# L, B9 N3 l7 E' B1 f3 H4 ~
P = pascal(___,classname)使用先前语法中的任何输入参数组合返回类classname的矩阵。 classname可以是'single'或'double'。
$ y" k/ M4 g0 {; P( @  |
4 S3 x$ b' g2 h4 l1 B# o5 H, x" Z' e9 q- W; v7 T2 P
Matrix from Pascal's Triangle
' h- H$ d, h+ W4 q6 o1 E* _+ q; U0 N6 U+ U0 C' h& t
- R! V! k! b9 ^& R) D
Compute the fourth-order Pascal matrix.
( N0 l+ |- |% t
8 S5 H# f+ G" n; h$ A' \# C' G2 BA = pascal(4)4 g& c/ {! t) `9 P

* o6 s% }* K. vA = 4×4
: p) {( Q' j! c' n8 j; g& J* a: f# \4 Z! n; c
     1     1     1     1$ T* l9 X. T. W$ s/ y
     1     2     3     4
4 A9 h2 e. S! ?/ R  A     1     3     6    10+ A  o1 f  A; f
     1     4    10    20
3 _4 V7 d! i# C# P% z8 I
) y) ]* N) u! W+ qCompute the lower triangular Cholesky factor of the third-order Pascal matrix, and verify it is involutory.) Y  A/ n4 k) u1 N* u
2 x4 ~$ M/ [/ Z9 q0 C7 `
A = pascal(3,1)8 O3 N) o8 `" g

% D( l$ v  g; B% S, e
5 Y; m- Y7 l# e' ]; o& E4 QA = 3×3
. X7 Z* Z% G( D& Y% m4 b1 S' F" Y7 l
     1     0     0
2 e6 J% c5 f; h, S7 N. l     1    -1     0! l0 ~) c, p7 z
     1    -2     1
. J, g+ q- w4 K1 B( e) h
7 r9 W; z+ ^7 W( w1 m) oinv(A)
1 ]( ^* P; \( T2 Y
. a' p2 P( _4 jans = 3×3
# Z2 D( D6 A# g2 s2 U/ }  W/ ?5 R7 i; g+ X/ S0 K+ o
     1     0     0
& F" \" k. f, x- n& P2 _' t7 V     1    -1     0. a/ B7 v& H+ }, Q! J
     1    -2     1) u7 U0 \2 ^9 i* a: n% B. r# t* e

! Y+ S# j% J* V; a, Q3 g帕斯卡的矩阵
$ B5 E/ w7 J( M/ C帕斯卡的三角形是由数字行组成的三角形。 第一行具有条目1.每个后续行通过添加前一行的相邻条目而形成,替换为0,其中不存在相邻条目。 pascal函数通过选择与指定矩阵维度相对应的Pascal三角形部分来形成Pascal矩阵,如图所示。 概述的矩阵对应于MATLAB®命令pascal(4)。
! j" S) Y& |8 k% O/ K, E% E8 C& y5 m: p6 X2 Q, Q( w, {  z$ G

& e4 B5 ~$ h* C* u+ C9 V. p4 `
" X8 Q+ [  T: B. s% C0 E  Q# l9 ~根据上述描述,我们猜测,pascal(3)为:
% N1 P% `* E$ ^* f( G) s  h$ b! v+ _" q( y0 z" ]3 y- X; ?( e
1  1  10 M  G# B( P& t# p. e6 A; E

: K" V- }2 j6 p8 [1  2  3
; ?" c" g; I' L" o$ j2 B4 Q9 U7 F% V
1  3  6+ y2 n/ l6 f; A( w

$ s( X. Y5 O2 E验证下:
( e8 D* w4 u+ ?4 b: @& N- P& j) b1 Y$ g! s( [- K6 n+ o
>> pascal(3)! H: Z, |: `* U; k# Y
' [- u7 |: e) \9 H
ans =
* i% E: u( L1 R. J# ?$ F
, I5 [4 ?; C- `     1     1     1
6 F# [% o: `; Z1 v: L+ S, A. G( G. M     1     2     32 i* n$ N" K3 U- Z; C- a
     1     3     6, q) K/ b; e6 k  ]4 K( o5 `1 G
3 u6 s* _, e" q& {
确实如此!: _. b; a' }) t; ]" v1 ~3 R0 z6 v% `
. V4 ?8 e! T& b! a6 t

" A6 f6 ^- z9 ?9 T& X3 n5 _' v/ w

该用户从未签到

2#
发表于 2020-1-10 17:48 | 只看该作者
MATLAB的Pascal matrix 学习
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-7-20 20:39 , Processed in 0.125000 second(s), 26 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表