Create Sparse Finite Difference Matrix without Loop
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
KSSV
2017-4-7
You can create your matrix something like this:
d1 = 1:5 ;
d0 = 1:6 ;
d2 = 1:5 ;
A = diag(d2,-1)+diag(d0)+diag(d1,1) ;
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!