First estimate the VAR (X,Y) with the function vgxvarx. Then estimate the parameter f with a regression. After having estimated the VAR, you know u1, so you can regress u2 on u1 (wich is identical to e1). However, for the impulse response you cannot use the Matlab function vgxproc because you don't have a standard VAR. Your VAR looks like this:
[X;Y](t+1) = [a;b] + [A,B;C,D]*[X;Y](t) + [1,0;f,1]*[e1;e2](t+1)
So you have to calculate the impulse response yourself. Set for example e1(1) = 1, e2(0) = 0, X(0) = 0 and Y(0) = 0 and compute X(1) and Y(1). Then compute u1 and u2 and extract e1 and e2. Now repeat this process again and again.