【 MATLAB 】Pascal matrix 介绍

版权声明:本博客内容来自于个人学习过程中的总结,参考了互联网、数据手册、帮助文档、书本以及论文等上的内容,仅供学习交流使用,如有侵权,请联系,我会重写!转载请注明地址! https://blog.csdn.net/Reborn_Lee/article/details/83245124

pascal

Pascal matrix

Syntax

P = pascal(n)

P = pascal(n,1)

P = pascal(n,2)

P = pascal(___,classname)

Description

P = pascal(n) returns a Pascal’s Matrix of order nP is a symmetric positive definite matrix with integer entries taken from Pascal's triangle. The inverse of P has integer entries.

P = pascal(n)返回阶数为n的Pascal矩阵。 P是对称正定矩阵,其整数条目取自Pascal的三角形。 P的倒数具有整数条目。

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.

P = pascal(n,1)返回Pascal矩阵的下三角Cholesky因子(直到列的符号)。 P是非自愿的,也就是说,它是它自己的逆。

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.

P = pascal(n,2)返回pascal(n,1)的转置和置换版本。 在这种情况下,P是单位矩阵的立方根。

扫描二维码关注公众号,回复: 3755302 查看本文章

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'.

P = pascal(___,classname)使用先前语法中的任何输入参数组合返回类classname的矩阵。 classname可以是'single'或'double'。



Matrix from Pascal's Triangle

Compute the fourth-order Pascal matrix.

A = pascal(4)
A = 4×4

     1     1     1     1
     1     2     3     4
     1     3     6    10
     1     4    10    20

Compute the lower triangular Cholesky factor of the third-order Pascal matrix, and verify it is involutory.

A = pascal(3,1)
A = 3×3

     1     0     0
     1    -1     0
     1    -2     1

inv(A)
ans = 3×3

     1     0     0
     1    -1     0
     1    -2     1


帕斯卡的矩阵
帕斯卡的三角形是由数字行组成的三角形。 第一行具有条目1.每个后续行通过添加前一行的相邻条目而形成,替换为0,其中不存在相邻条目。 pascal函数通过选择与指定矩阵维度相对应的Pascal三角形部分来形成Pascal矩阵,如图所示。 概述的矩阵对应于MATLAB®命令pascal(4)。

根据上述描述,我们猜测,pascal(3)为:

1  1  1

1  2  3

1  3  6

验证下:

>> pascal(3)

ans =

     1     1     1
     1     2     3
     1     3     6

确实如此!

猜你喜欢

转载自blog.csdn.net/Reborn_Lee/article/details/83245124