tridiagonal matrix
1 次查看(过去 30 天)
显示 更早的评论
Hi there. i have this equation | 0.99y(i+1) -2y(i) +2.01y(i-1)=0,0002 | i want i from 1 to 99. So i will have 99 equations with 99 unknowns. The first step is to make a tridiagonal matrix and store the numbers : 0.99 , -2 , 2.01 . How can i do that ?
0 个评论
采纳的回答
Sean de Wolski
2011-5-25
TD = full(gallery('tridiag',100,0.99 , -2 , 2.01))
EDIT Per Comment:
y = TD\B;
4 个评论
Sean de Wolski
2011-5-25
It is seeing all digits (64bit floating point), you're not viewing them all...
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!