What's the meaning of N = input(10)? I am guessing that what you wanted to do is to pass N to a function. But, if so, why ask for its value again inside the function? And if you know the first value is always -1 you don't really need to pass it either.
If you want to return a vector
function your_result = coin_toss(N);
%Preallocating for your_result:
your_result = zeros(N,1);
%Perform your calculations
your_result(1) = -1;
for ii = 2:N
%do your stuff
your_result(ii) = %You might know how to do this since it has already been answered
end
%You might also know how to do the rest. Hint: cumsum()