creating a diagonal matrix in matlab
creating a diagonal matrix in matlab
(OP)
hi
I'd like to create a matrix that looks something like;
a c 0 0 0 0
b a c 0 0 0
0 b a c 0 0
0 0 b a c 0
0 0 0 b a c
0 0 0 0 b a
Where b, a, and c are contants. I'l like to be able to set the matrix size as well [the matrix should be square].
Any ideas
thanks!
Charlie
I'd like to create a matrix that looks something like;
a c 0 0 0 0
b a c 0 0 0
0 b a c 0 0
0 0 b a c 0
0 0 0 b a c
0 0 0 0 b a
Where b, a, and c are contants. I'l like to be able to set the matrix size as well [the matrix should be square].
Any ideas
thanks!
Charlie





RE: creating a diagonal matrix in matlab
one of the many solutions :
CODE
toeplitz([a b zeros(1,n-2)],[a c zeros(1,n-2)])
Jérôme