fork download
  1. f = @(s,n)[s;32+94*rand(n,nnz(s))](1:end-n)
  2.  
  3. f('This is a string', 3)
  4. f('Octave > MATLAB when golfing', 5)
Success #stdin #stdout #stderr 0.21s 103360KB
stdin
Standard input is empty
stdout
f =

@(s, n) [s; 32 + 94 * rand(n, nnz (s))] (1:end - n)

ans = Twuah8h4i,^Us?Jr t:Eiom^s52: up[akey QE)s,<;tBPwr]J i*Dwn'L+g
ans = O\&-wOc3_/3KtWV'.wadBPwcvz.Ox*e%&N=t $la7:>EVJ:6 uL5G>MsQa'*ABH'I+TmjjK3L94|l@ATRXN[B9wBR% o\[dkwE$?v[hXN1P-e\K|csng;@'T _hv[*g:z+`CoW>=uAl"@UO=f-5I4"i/=y[2nUSPhZg

stderr
warning: implicit conversion from numeric to char
warning: called from
     at line -1 column -1
warning: implicit conversion from numeric to char
warning: called from
     at line -1 column -1