How can I create sparse symmetric positive definite linear system?

조회 수: 12 (최근 30일)
D
D 2013년 8월 6일
댓글: sai chand 2019년 7월 17일
Dear All :) I'm looking for sparse symmetric positive definite linear system Ax=b. Is it possible to generate it in Matlab? I need matrix A about 50x50 (maximum 100x100 - minimum 20x20) and vector b. It might be floating point numbers... I prefer not compressed format ;)
Thank you in advance.
D.

채택된 답변

Richard Brown
Richard Brown 2013년 8월 6일
편집: Richard Brown 2013년 8월 6일
sprandsym is what you want.
m = 50;
density = 2/m; % for example
rc = 0.1; % Reciprocal condition number
A = sprandsym(m, density, rc, 1);
If you don't want it in compressed column format
A = full(A);
Verify positive definiteness
chol(A);
  댓글 수: 4
sai chand
sai chand 2019년 7월 17일
How to generate the matrix b.
Can it be a random one independent of the way A is generated?
sai chand
sai chand 2019년 7월 17일
I needed to generate a symmetric sparse positive definite matrix. can you help me in that?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by