Problem 1812. Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix.
Example
a=1 b=2 c=3 n=5 T = [2 3 0 0 0; 1 2 3 0 0; 0 1 2 3 0; 0 0 1 2 3; 0 0 0 1 2]
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Ned Gulley
on 15 Aug 2013
I fixed the test suite so that n is used instead of d.
goc3
on 15 Mar 2017
Additional test cases have been added.
Robert Ritter
on 13 Dec 2021
great!
Solution Comments
Show commentsProblem Recent Solvers149
Suggested Problems
-
22378 Solvers
-
2307 Solvers
-
Is my wife right? Now with even more wrong husband
1331 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1169 Solvers
-
convert matrix to single column
419 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!