フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

write a recursive function to find maximum element of an array , I'm having difficulty to write this program

1 回表示 (過去 30 日間)
Piyush Gupta
Piyush Gupta 2020 年 9 月 10 日
閉鎖済み: Ameer Hamza 2020 年 9 月 10 日
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

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by