write a function to find maximum element of an array using recursion

function mx = recursion_max(v)
n=size(v);
if size(v) <2
mx = v(1);
else mx = max(recursion_max(v(n-1)), mx );
end
end

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

질문:

2020년 9월 10일

편집:

2020년 9월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by