Returning Values from function inside of a for loop

Hello all,
I tried to call a function inside of a for lop. The function is correct, but the way the for loop is working does not seem correct. Probably user error, but here is what happens (example code).

function retval = scrap (input1)
 retval=10;
 endfunction
for i = 3:5
out(i,:)=scrap(i)
endfor
vi =

    0
    0
   10

vi =

    0
    0
   10
   10

vi =

    0
    0
   10
   10
   10

I expected to get an out put of [10,10,10]. My actual code is a result of a pressure fluctuation.

Windows10
Octave 6.3.0
extracted 7zip

Answered My own question:

index for output must resolve to one. ie

for i=352:578
out(i-351,:)=i;
endfor

Mon