The y in the function example has nothing to do with the y from the load y command so the question is unclear as to why you're referring to the latter...unless there's code not shown which SAVE d the x and y after you ran the function and you used the intermediary from the disk to get the output of the function later on instead of just saving the results of running the function itself???
If that's the case, IA's Answer is spot, but why not save the intermediary step and write
[x,y,T] = example(v,sigma,G,N,K);
[maxy,iy]=max(y);
maxx=x(iy);
?
As to the second question, there is only one value of T returned and it will correspond to whichever condition is T in the IF block; the other branch will never be evaluated. If it's important as to which condition is so, you could add another output which is a flag variable that has the value of true/false or 0/1 or -1/+1, whatever set of values you wish to indicate that condition.