% I am writing a code to find the palindrome of a string using recursion but i am getting the error The function call palindrome('madam') caused an error and did not complete (MATLAB:TooManyOutputs)
function palindrome(v) if length(v) <= 1 true return; end if v(1) ~= v(end) false return; end palindrome(v(2:end-1));end
MATLAB: I am trying to write a recursive code to check whether a string is palindrome or not, when i am running a trial case a error message shows up stating “he function call palindrome(‘madam’) caused an error and did not complete (MATLAB:TooManyOutput
matlab functionpalindrome
Best Answer