why mod(rref(A), 2) does not give the correct result?
    조회 수: 10 (최근 30일)
  
       이전 댓글 표시
    
Lets say I have the followings all in mod 2
a = [1 1 0 0 0]'
b = [1 0 1 0 1]'
c = [0 1 1 0 1]'
clearly, c = a + b in mod 2
However when I run the command
mod(rref([a b c]), 2)
It does not give the corret result for linear combination in mod 2? My expect answer should be:
expected_ans = [1 0 1; 0 1 1; 0 0 0; 0 0 0; 0 0 0]
Could anyone explain why?
댓글 수: 0
채택된 답변
  David Goodmanson
      
      
 2025년 5월 30일
        
      편집: David Goodmanson
      
      
 2025년 5월 30일
  
      Hi Lily,
Although c is a linear combination of a and b mod 2, rref does not know anything about mod 2.
rank([a b c])
 ans =  3
As far as rref is concerned, a, b and c are linearly independent ('mod' not being a linear operation under the usual addition of numbers).  So you get three nonzero rows.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

