Azzera filtri
Azzera filtri

comparing values of two matrix

1 visualizzazione (ultimi 30 giorni)
Akmyrat
Akmyrat il 13 Ago 2014
Risposto: Andrei Bobrov il 13 Ago 2014
Hi lets say I have 2 matrices A=[1 2 1 2 3 3], B=[1 2 2 1 3 3], i want to compare values of matrix and write in different matrix C, if same "s", if not same "n". result should be C=['s' 's' 'n' 'n' 's' 's'], thanks !!

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 13 Ago 2014
c0 = {'n','s'};
C = c0( 1+(A == B));

Più risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by