필터 지우기
필터 지우기

How do I check to see if the elements in a matrix are all equal?

조회 수: 53 (최근 30일)
katherine keogh
katherine keogh 2020년 9월 11일
댓글: madhan ravi 2020년 9월 11일
So if I have matrix A=[1 1 1 ; 1 1 1 ; 1 1 1] I would like to run a check so check if all the elements in the matrix are the same. Or say matrix B = [1, 0 1; 0 1 0; 1 1 0] I would liek to run a check to see if the elements are all the same ( in this case they aren't).

채택된 답변

madhan ravi
madhan ravi 2020년 9월 11일
a = num2cell(A);
isequal(a{:})

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by