Removing values form the Matrix
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Andrei Bobrov
2013-3-13
编辑:Andrei Bobrov
2013-3-13
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 个评论
M@lik Ali
2013-3-13
Andrei Bobrov
2013-3-13
corrected
Azzi Abdelmalek
2013-3-13
This solution is more general
类别
在 帮助中心 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!