Difference Matrix

Builds the matrix that takes the column-wise difference of another matrix when post-multiplied.
ダウンロード: 506
更新 2010/4/16

ライセンスの表示

D = diffMat(obs,type)

Creates a difference matrix, D, that when multiplied by by another matrix takes its difference over obs columns. The type is either 'circular' or 'none'. The defalt is 'none'.

EXAMPLE
B = [2:1:8;sin(linspace(0,pi,7))]
B =
2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000
0 0.5000 0.8660 1.0000 0.8660 0.5000 0.0000

D = diffMat(size(B,2));
B*D
ans =
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-0.5000 -0.3660 -0.1340 0.1340 0.3660 0.5000

B*diffMat(size(B,2),'circular')
ans =
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 6.0000
-0.5000 -0.3660 -0.1340 0.1340 0.3660 0.5000 0.0000

引用

Zachary Danziger (2024). Difference Matrix (https://www.mathworks.com/matlabcentral/fileexchange/27270-difference-matrix), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2009a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersPolynomials についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0