Matlab tril function does not work as expected
古いコメントを表示
I am using Matlab2019a. When I was using tril an triu functions for generating triangular matrix, they ony give single values. Here are their function descriptions when type editing commdands:
tril Extract lower triangular part.
tril(X) is the lower triangular part of X.
tril(X,K) is the elements on and below the K-th diagonal
of X . K = 0 is the main diagonal, K > 0 is above the
main diagonal and K < 0 is below the main diagonal.
triu Extract upper triangular part.
triu(X) is the upper triangular part of X.
triu(X,K) is the elements on and above the K-th diagonal of
X. K = 0 is the main diagonal, K > 0 is above the main
diagonal and K < 0 is below the main diagonal.
When typing a simple command:
tril(4)
it gives a single value 4
Why the version of Matlab does not support the offiicially claimed functionalities (both introduced since 2006a) as described at https://www.mathworks.com/help/matlab/ref/triu.html and https://www.mathworks.com/help/matlab/ref/tril.html
1 件のコメント
James Tursa
2020 年 4 月 12 日
You are going to have to provide examples of why you think they don't work rather that just making a blanket statement.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!