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일

댓글을 달려면 로그인하십시오.

답변 (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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by