How to create a matrix?

1 次查看(过去 30 天)
Hi all, I am trying to create a matrix (101x101) like this :
Can anyone help me with the code please?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-4-2
编辑:Azzi Abdelmalek 2016-4-2
n=4 % in your case use n=101
out=tril(2*ones(n),-1)
  1 个评论
jack star
jack star 2016-4-2
Thank you very much for your answer.
Now I'm trying to solve this matrix:
Y= U x g
% Y(101x1) and U(101x101) matrixes.
to find g, i used this g = inv(U)*Y
But it found g(101x1) NaN matrix. You have any idea why?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by