How to check that two column vectors are multiple of each other?
조회 수: 4 (최근 30일)
이전 댓글 표시
Example [1;2;3] and [2;4;6]. Are there any specific functions i can use?
댓글 수: 0
채택된 답변
Star Strider
2018년 5월 18일
One option is to concatenate them and then use the rank function to check to see if they are linearly dependent.
For this particular problem, this works:
a = [1;2;3];
b = [2;4;6];
c = [a b];
LinDep = rank(c) < min(size(c))
Here, if ‘LinDep’ (‘linearly dependent’) is true (or 1), at least two columns or rows are multiples of each other.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!