How can i write and use the attached matrix in MATLAB for any value of N
4 次查看(过去 30 天)
显示 更早的评论
1 个评论
Walter Roberson
2020-8-9
That is clearly a homework assignment, so if we were to answer showing you how to create the matrix, we would have to deliberately make a long program.
回答(1 个)
Abdolkarim Mohammadi
2020-8-9
编辑:Abdolkarim Mohammadi
2020-8-9
M = (n:-1:0) + (0:n)';
or
M = (n:2*n)' - (0:n);
3 个评论
Abdolkarim Mohammadi
2020-8-9
Sorry Walter. I wasn't aware of this. I agree with you that the best way of learning is trying to figure out the code.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!