Octave--compare two matrix
조회 수: 7 (최근 30일)
이전 댓글 표시
How can I insert the row of matrix A into matrix M if the whole row of matrix A and matrix B are the same?
There is the example
>> A = [1 2; 3 4]
A =
1 2
3 4
>> B = [1 2; 3 6]
B =
1 2
3 6
M =
1 2
댓글 수: 0
채택된 답변
JESUS DAVID ARIZA ROYETH
2020년 2월 15일
M=A(ismember(A,B,"rows"),:)
댓글 수: 7
Rik
2020년 2월 16일
Note that Matlab and Octave are sufficiently similar that basic tutorials will work for both. There are several places you can find the most important syntax differences. One of them you encountered here: single and double quotes are interchangeable in Octave, in Matlab they are not.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!