I'm not sure what you're trying to achieve. However,
modulated = zeros(1, 200*num_bit)
crates an array with 1 rows and plenty of columns
modulated(200*(index-1)+1, 200*index)
tries to access rows 1, 201, 401, ... of the array which has only 1 row as you created it. So, of course index exceeds dimension
Note that even if the index was valid, as it is the line is pointless since you don't do anything with the value you've read.
Best Answer