|
回复 15楼 zhly 的帖子
我目前无matlab试, 但由网路看帮助文档, 如下
^
Matrix power. X^p is X to the power p, if p is a scalar. If p is an integer, the power is computed by repeated squaring. If the integer is negative, X is inverted first. For other values of p, the calculation involves eigenvalues and eigenvectors, such that if [V,D] = eig(X), then X^p = V*D.^p/V.
If x is a scalar and P is a matrix, x^P is x raised to the matrix power P using eigenvalues and eigenvectors. X^P, where X and P are both matrices, is an error.
.^
Array power. A.^B is the matrix with elements A(i,j) to the B(i,j) power. A and B must have the same size, unless one of them is a scalar.
a不是方阵, 应该会报错才是, 爲何不报错目前不得而知
但可以确定的是连加是a'.^(D-1)
还有LZ这个较偏编程问题, 建议院长或版主移至MATLAB区块 |
|