Don't use size(inputVector) for your loop indexing limits since this is a vector. Use numel(inputVector) instead.
Also, you shouldn't be increasing the size of outputVector iteratively inside your loop. Each time you do that, the memory for the variable has to get copied to new memory. This can hurt the performance in a massive way. Instead, pre-allocate and use indexing. E.g., instead of this:
outputVector = ;
outputVector = [outputVector,1] ;
outputVector = zeros(size(inputVector));
outputVector(i) = 1;
There are also ways to calculate your result without using a loop.