how to tell if two elements in an array are identical
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Milan Parsotam
el 6 de Sept. de 2018
Editada: Milan Parsotam
el 22 de Sept. de 2018
Hi all I need help on this. I am rather new to matlab so im sure this is an easy fix, but how would i write a code/ is there a function pre existing on matlab that is able to detect if any two(or more) elements in an array are identical, and if possible how to change the identical values
0 comentarios
Respuesta aceptada
madhan ravi
el 6 de Sept. de 2018
Editada: madhan ravi
el 6 de Sept. de 2018
Use:
isequal(A,B) %to check they are the same.
Or
A=1:5
B=[1 4 5 2 8] % to find where they are identical
index=find(ismember(A,B))
%this command represents A which is in B
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!