Info
此问题已关闭。 请重新打开它进行编辑或回答。
i want create this matrix
1 次查看(过去 30 天)
显示 更早的评论
i want create this matrix in one ligne command and use (ones,eye...)
m =
1.0000 3.1416 3.0000 4.0000 0 0 5.0000
1.0000 0 3.1416 4.0000 0 0 6.0000
1.0000 0 0 3.1416 0 0 7.0000
1.0000 0 0 0 3.1416 0 8.0000
1.0000 0 0 0 0 3.1416 9.0000
3 个评论
Guillaume
2019-11-27
Just write the matrix in your code as you've written it above. It'll be so much more readable that any one-liner and instantly clear what the matrix is.
Case in point, I'll challenge anyone reading Jesus' one liner to say what matrix it generates immediately upon reading the code.
回答(1 个)
JESUS DAVID ARIZA ROYETH
2019-11-27
solution :
m=[ones(5,1) pi*eye(5) (5:9)']+[diag(4,3)+diag(3:4,2) zeros(4,3 ); zeros(1,7)]
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!