News for hackers. Stuff that matters.
Re:Array Iteration Interview Problem by pjm4ycombinator on Thursday August 02, 2012 @12:55AM (#4327347)
With MATLAB, find is built-in!

  function arr=add1(arr,val,n)
  if n==0
      ind=find(arr==val);
  elseif n>0
      ind=find(arr==val,n);
  else
      ind=find(arr==val,-n,'last');
  end
  arr(ind)=arr(ind)+1;

There are no comments on this comment yet.