📅  最后修改于: 2022-03-11 14:57:39.357000             🧑  作者: Mango
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