# Octave--compare two matrix

11 visualizaciones (últimos 30 días)
Michelle Leung el 15 de Feb. de 2020
Comentada: Rik el 16 de Feb. de 2020
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 comentariosMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos

Iniciar sesión para comentar.

JESUS DAVID ARIZA ROYETH el 15 de Feb. de 2020
M=A(ismember(A,B,"rows"),:)
##### 7 comentariosMostrar 6 comentarios más antiguosOcultar 6 comentarios más antiguos
Rik el 16 de Feb. de 2020
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.

Iniciar sesión para comentar.

### Categorías

Más información sobre Octave en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by