Removing values form the Matrix
Ältere Kommentare anzeigen
Hi, All
i have two matrix matrix A has size 2 62 matrix B has size 10 62
actually the matrix B contains also matrix A
i want to remove the matrix A from matrix B.
How i can do this
Akzeptierte Antwort
Weitere Antworten (1)
Andrei Bobrov
am 13 Mär. 2013
Bearbeitet: Andrei Bobrov
am 13 Mär. 2013
in your case:
B = randi(100,10,62);
A = B(4:5,:);
B(end,:) = A(1,:); % your data
[a,ii] = ismember(B,A,'rows');
iii = 1:size(A,1);
i1 = strfind(ii(:)',iii) + iii - 1;
B(i1,:) = [];
3 Kommentare
M@lik Ali
am 13 Mär. 2013
Andrei Bobrov
am 13 Mär. 2013
corrected
Azzi Abdelmalek
am 13 Mär. 2013
This solution is more general
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!