I'm having trouble creating a function that would reverse a character array using recursion. For example, I want my function to return 'py' when inputting "yp". My overall code doesn't seem right though.
function array2 = charReversal(array1)if array1==0 return;else array2=chsrReversal(reverse(array1,array1-1)); disp(array2)end
Best Answer