Solving a matrix (bidiagonal) in MATLAB

4 vues (au cours des 30 derniers jours)
Jump Man
Jump Man le 3 Mar 2016
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.

Réponses (1)

Andrei Bobrov
Andrei Bobrov le 3 Mar 2016

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by