Answers for "octave two outputs of a function"

0

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
Posted by: Guest on January-25-2021
0

octave two outputs of a function

function [x, y, z] = f ()
  x = 1;
  y = 2;
  z = 3;
endfunction

[a, b, c] = f ()
Posted by: Guest on January-25-2021

Browse Popular Code Answers by Language