diag(.) does not work

5 Ansichten (letzte 30 Tage)
Hye-Jin Kim
Hye-Jin Kim am 27 Okt. 2018
Kommentiert: Stephen23 am 27 Okt. 2018
diag function works in a wrong way as shown in the figure. How can i fix it?
  2 Kommentare
Matt J
Matt J am 27 Okt. 2018
What happens when you do,
>> whos diag
Stephen23
Stephen23 am 27 Okt. 2018
whos diag -all

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
Walter Roberson am 27 Okt. 2018
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 am 27 Okt. 2018
Try
clear all
x=[8 1 6;3 5 7;4 9 2]
diag(x)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by