This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %way (assuming my baseChange function is f(num,base)) % If my input was f('3',4), what would my output be? %  If my input was f('31',4), what would my output be? What would % it be in terms of f('3',4)? %  If my input was f('312',4), what would my output be? What would % it be in terms of f('31',4)? % (etc.) %Constraints: %In order to receive credit for this problem, you MUST use recursion. %Also, you may not use dec2bin, bin2dec, base2dec, dec2base or any other %function which changes the base of a number for this problem. Problems %using these functions are subject to an automatic zero. if isempty(str) %terminating condition num = 0; % else number = str2num(str(1)); num = chgBase(str(2:end),numin) + number.*numin.^(length(str)1); end end...
View
Full
Document
This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.
 Spring '08
 Stallworth
 Recursion

Click to edit the document details