Borrar filtros
Borrar filtros

find guite the same elements

1 visualización (últimos 30 días)
Konstantinos Kontos
Konstantinos Kontos el 1 de Jun. de 2012
Hello everyone
I have a mXn matrix called Theseis that it has the above elements in spread around the table and in any other point has 0.
1056 2629
1056 2630
1056 2631
1057 2629
1057 2630
1057 2631
1058 2629
1058 2630
1058 2631
1419 3663
1419 3664
1420 3663
1420 3664
1421 3663
1421 3664
1757 2644
1758 2643
1758 2644
1759 2643
1759 2644
2427 3664
2427 3665
2428 3664
2428 3665
2429 3664
2429 3665
2613 2646
2614 2646
2615 2645
2615 2646
Is there a way to find which elements are the same(except the zeros) or guite the same(eg these are guite the same:
2613 2646
2614 2646
2615 2645
2615 2646
) and delete them and leave only one of each group. eg the new maytix will be
1056 2631
1419 3663
.......................etc

Respuesta aceptada

Konstantinos Kontos
Konstantinos Kontos el 10 de Jun. de 2012
The answer for everyone who wants it is quite simple!
for i=1:x-200
for j=1:y-800
if mean2(Pattern_epikef==Foto2(i:i+23,j:j+75) ) >= 0.87
Theseis(i-2:i+2,j-2:j+2) = 0;
Theseis(i,j)=1; % ana vreis omoio kommati dose 1 ston pinaka
end
end
end

Más respuestas (1)

Elad
Elad el 1 de Jun. de 2012
let say you have 2 vector A ,B (like your columns there) you can do something like : [C, ia] = unique(A); for k = 1:length(ia) D(k)=B(ia(k)) end then do the same with D with respect to C and you are done. for M x N you can extend this to run on all the columns ..,

Categorías

Más información sobre Creating and Concatenating Matrices 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