Hello, I'm trying to write a function that will convert binary to decimal using recursion, but I am having difficulty getting the recursive part.
function y = Bin2dec(BA)n = length(BA);if n == 1 y = BA;else y = Bin2dec(BA(n-1));end
recursion
function y = Bin2dec(BA)n = length(BA);if n == 1 y = BA;else y = Bin2dec(BA(n-1));end
Best Answer