% resi3 test a = (1:5)'; b = (1:6)'+10; c = (-5:-1)'; f = sin(1:6)'; x = resi3(a,b,c,f) % resi3_test % x = % 0.105097204324943 % 0.062919652553295 % -0.012291097965299 % -0.058354992167388 % -0.048520344465699 % -0.002300860991902