- You can subtract/add/multiply/divide any sized array with a scalar without repmat so you're "fixing" a problem that isn't a problem to begin with ( :) ), and
- You've got parentheses-nesting problem in the way you wrote the arguments to repmat if you are going to do it...
will get as far as the subtraction, but then the matrix multiply will be non-conforming as you'll have [10000x1]*[10x1] and the inner dimensions must match. You could write the transpose there for the second if the result is intended to be [10000x10].
But, as pointed out at the top, just write
or otherwise solve the latter problem on the end result size.
I just noticed both OCDER and I missed the 'dot' in the .* element multiply. There's an issue there in commensurate sizes as well; the problem in answering the Q? is that the intended result is ill-defined such that the intent is not known.
Explain what the output result is intended to be; perhaps illustrate the desired result with a set of small sample inputs (making up such an example might just let you see the answer to the problem on your own, even).