I want to use matlab coder, but chol is not implemented in C yet

2 ビュー (過去 30 日間)
Greg Bishop
Greg Bishop 2017 年 2 月 15 日
回答済み: Raghu Boggavarapu 2021 年 11 月 26 日
Does anyone have a "by hand" version of [V,D] = eig(A) or [V] = eig(A) that works like [V,D] = eig(A,B,'chol') does in matlab? I did my own scaling to make everything scale to 1, but 'qz' just isn't cutting it. Performance does not matter here, as this isn't called repeatedly, just its results.
I found a by hand implementation of chol. But it doesn't seem to produce the same answers for a 3x3 matrix as matlab's chol does, it seems to work for 4x4 though. Even if it did, I need the eigenvectors (and eigenvalues) for it using chol.
For instance the positive definitive value:
A=[3,1,0;0,3,1;0,0,3]
gives
chol(B)
= 1.7321 0.5774 0
0 1.6330 0.6124
0 0 1.6202
cholesky(B,'upper')
= 1.7321 0 0
0 1.7321 0
0 0 1.7321

回答 (1 件)

Raghu Boggavarapu
Raghu Boggavarapu 2021 年 11 月 26 日
MATLAB Coder supports chol and eig for code generation. Refer to respective documentation pages:

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by