Create a matrix with non zero entries on the diagonal and subdiagonal and zero elsewhere
2 次查看(过去 30 天)
显示 更早的评论
I am confused on how to generate a 4 by 4 matrix which has ones on the diagonal and zeroes on the lower subdiagonal right beneath the diagonal and 2s on the subdiagonal right above the diagonal. In addition, there should be 0 entries elsewhere.
1 个评论
James Tursa
2021-3-4
What have you done so far? What specific parts of your code are you having problems with?
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!