How do I verify a statement and display the resulting matrix that consists of logical 1 or 0?

조회 수: 1 (최근 30일)
Hi, here is the question: Write the statement which verifies whether D is a symmetric matrix. Display the resulting matrix matl, consisting of logical 1 or 0.
here is matD:
matD =
756.0160 458.6732 679.2602 208.3018
458.6732 286.0436 416.9705 136.3031
679.2602 416.9705 613.3440 193.3708
208.3018 136.3031 193.3708 70.0789
Thank you so much!

답변 (2개)

KSSV
KSSV 2017년 10월 27일
Let A be your matrix...
iwant = isequal(A,A') ;
Read about isequal .

Jan
Jan 2017년 10월 27일
편집: Jan 2017년 10월 27일
Or considering the limited precision:
matDT = matD.';
k = 10;
R = abs(matD - matDT) < k * eps(max(abs(matD), abs(matDT)))
The value of k, (k >= 1) is more or less arbitrary and depends on the specific problem.

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by