diag(.) does not work

5 ビュー (過去 30 日間)
Hye-Jin Kim
Hye-Jin Kim 2018 年 10 月 27 日
コメント済み: Stephen23 2018 年 10 月 27 日
diag function works in a wrong way as shown in the figure. How can i fix it?
  2 件のコメント
Matt J
Matt J 2018 年 10 月 27 日
What happens when you do,
>> whos diag
Stephen23
Stephen23 2018 年 10 月 27 日
whos diag -all

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2018 年 10 月 27 日
I suspect you accidentally assigned zeros to a variable named diag, so your call is indexing rather than invoking the function.

madhan ravi
madhan ravi 2018 年 10 月 27 日
Try
clear all
x=[8 1 6;3 5 7;4 9 2]
diag(x)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by