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.

583 correct solutions
293 incorrect solutions

Last solution submitted on Jun 23, 2016

1 Comment

Shayan Majidy
on 31 May 2016 at 23:17

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