If you have the Image Processing Toolbox, it's trivial - just a single line of code:
where 3 is the longest length of 0's that you want to allow. 100 thousand elements is no problem - this is just a very small fraction of the number of elements it usually works on (tens of millions of elements or pixels), so it will be pretty fast. If you don't have that toolbox , there are some trickier, more complicated ways to do it. Let us know and someone will probably work it out for you.