MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by huda nawaf
on 28 Mar 2012

hi, I want to remove any two item are equal without loop x=[1 2 3 5]; y=[4 3 1 6 7]; I want the result be x=[2 5] y=[4 6 7] how do that? thanks

*No products are associated with this question.*

Answer by Wayne King
on 28 Mar 2012

Accepted answer

[~,inx,iny] = intersect(x,y); x(inx) = []; y(iny) = [];

## 0 Comments