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

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For example, the inputs:

a=[1 2 3 4 5];

b=[2 3 4 5 6];

would return [1 6], as 2, 3, 4 and 5 are in both a and b, and can therefore be eliminated. Please sort the returned vector in order from lowest to highest.

You may assume that there is at least one value that meets these criteria in a or b, and there are no NaN or Inf values in either a or b.

199 correct solutions
549 incorrect solutions

Last solution submitted on Aug 10, 2015

1 Comment

Noah
on 28 Jun 2012

When I run this solution in my local workspace, I pass... More investigation to be done.

3 Comments