Como faço comparação no matlab

Eu tenho duas matrizes com valores numericos: A (tamanho 44x1) e B (tamanho 42x1).

O que eu preciso fazer é:

  • contar quantas vezes os valores aparecem repetidos para A e B.
  • saber se estes valores que se repetem são comuns nas duas matrizes, se sim, dividir suas contagens.

Exemplo: 0.5 aparece 600 vzs na matriz A e 300 vzs na matriz B, então divide 600 por 300. 0.7 aparece 200 vzs na matriz A e 100 vzs na matriz B, então divide 200 por 100.

No final eu preciso ter duas colunas: uma com os numeros repetidos e outra com os valores da divisão.

| 0.5 | 2 | |:---- |:------:| | 0.7 | 2 |

Em python fica assim:

import pandas as pd data1 = pd.read_excel('C:/Users/Desktop/Python/data1.xlsx') data2 = pd.read_excel('C:/Users/Desktop/Python/data2.xlsx') for i in data1['Mag'].value_counts() & data2['Mag'].value_counts(): a = data1['Mag'].value_counts()/data2['Mag'].value_counts() print(a) break

Como faço em matlab? Valeu!

Input text, with each input specified as a character vector, a character array, a cell array of character vectors, or a string array. The order of the inputs does not affect the comparison results.

  • If both s1 and s2 are string arrays or cell arrays of character vectors, then s1 and s2 must be the same size, unless one of them is scalar.

  • If both s1 and s2 are character arrays with multiple rows, then s1 and s2 can have different numbers of rows.

  • When comparing a nonscalar cell array of character vectors or a string array to a multirow character array, the cell array or string array must be a column vector with the same number of rows as the character array.

Data Types: char | cell | string