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일

1 개 추천

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일

1 개 추천

Try
clear all
x=[8 1 6;3 5 7;4 9 2]
diag(x)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

태그

질문:

2018년 10월 27일

댓글:

2018년 10월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by