Solving a matrix (bidiagonal) in MATLAB

조회 수: 4 (최근 30일)
Jump Man
Jump Man 2016년 3월 3일
답변: Andrei Bobrov 2016년 3월 3일
I have a matrix of the following form:
d1 0 0 0 0 0 0 x1 b1
a1 d2 0 0 0 0 0 x2 b2
0 a2 d3 0 0 0 0 x3 b3
0 0 a3 d4 a4 0 0 * x4 = b4
0 0 0 0 d5 a5 0 x5 b5
0 0 0 0 0 d6 a6 x6 b6
0 0 0 0 0 0 d7 x7 b7
I need to write a code to solve this system without forward elimination. I was assuming you could just solve for x7 = b7/d7. Then solve for d6 by setting d6 = b6-a6*x7 = b6-a6*(b7/d7) from our first iteration...then carrying the rest backwards to the first row. However, I am experiencing a block:
1) How to hardcore the confusing differences in indeces
2) How to start from a reverse order down from d7 up to the first equation
3) Moreover, how do I generalize this for any system of n? According to personal readings I am doing for recreation, n is odd.
Can anyone assist me in coding this?
EDIT: The coefficient matrix is A, the x column vector can be denoted as X, and the b column vector can be denoted as B for convenience if needed.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2016년 3월 3일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by