Info
This question is closed. Reopen it to edit or answer.
write a recursive function to find maximum element of an array , I'm having difficulty to write this program
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!