MathWorks Interview Question

2. Given a vector with random numbers, how would you delete all elements which are divisible by 5?

Interview Answer

Anonymous

Dec 1, 2014

my answer: A = A(mod(A, 5)~=0), but I am not sure if A(mod(A, 5) == 0) = [] will be better in terms of space complexity