I think it's worth noting that the two random position codes you list aren't the same. If you want to do something like randperm in Mathematica you should use RandomSample. In addition to this, what you are trying to do is effectively to simultaneously address a large number of positions in the matrix. In Mathematica I do not believe you can do this for matrixes and other things with larger dimensions, however for a single list you can do this with speeds similar to MATLAB:
SeedRandom[322112432]
data = Flatten[RandomReal[1., {1000, 1000}], 1];
pos = RandomSample[Range[1, 5*10^5]];
Module[{temp = Flatten[data, 1]},
temp[[pos]] = 0.;
data = Partition[temp, 1000]
]; // AbsoluteTiming // First
(* 0.014001 *)
Where MATLAB returns Elapsed time is 0.058448 seconds. on my system. I believe the root of the difference here is that MATLAB treats your matrix like it was just a long list, and only uses the dimensions to translate between indexing using two coordinates and the singular index, while Mathematica has a more general structure, where you can't just assume that each row is the same length for the purpose of simultaneous indexing, which might be why you can't just do something like for instance data[[index[1,2],index[2,3]]]=0 for a matrix, even though you can do data[[{1,2}]]=0 for a list.
ReplacePart(as you seem to be). It should be possible to speed it up with other methods. Here's one:SparseArray[pos -> 0., Dimensions[data], 1.] data; // AbsoluteTiming. It is a critical but not so obvious point that I used0.and1.(machine precision inexact numbers) instead of0and1, to avoid unpackingdata. – Szabolcs Sep 04 '13 at 16:18ReplacePartis that it necessarily copies the entire expression. So, for large expressions the large overhead is pretty much inevitable with this method, particularly for comparatively small number of elements to be modified. – Leonid Shifrin Sep 04 '13 at 17:19