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

Learn moreOpportunities for recent engineering grads.

Apply TodayReturn 1 if number *a* exists in vector *b* otherwise return 0.

a = 3; b = [1,2,4];

Returns 0.

a = 3; b = [1,2,3];

Returns 1.

587 correct solutions
294 incorrect solutions

Last solution submitted on Jul 26, 2016

1 Comment

Shayan Majidy
on 31 May 2016

There is a pre-made function for this.
y = ismember(a,b)

1 Comment

Nichlas
on 17 Jul 2012

Thanks! Have updated tests.

1 Comment