octave function multiple output code example
Example 1: octave two outputs of a function
function [x, y, z] = f ()
x = 1;
y = 2;
z = 3;
endfunction
[a, b, c] = f ()
Example 2: octave two outputs of a function
function [max, idx] = vmax (v)
idx = 1;
max = v (idx);
for i = 2:length (v)
if (v (i) > max)
max = v (i);
idx = i;
endif
endfor
endfunction