Code covered by the BSD License  

Highlights from
NUMBER SYSTEMS/ BASE CONVERTER

image thumbnail

NUMBER SYSTEMS/ BASE CONVERTER

by

 

13 Aug 2006 (Updated )

Convert a number between different number systems-hex,oct,bin,dec.

b=str2num(a)
function b=str2num(a)

% This function converts a string into an array.
%  Class of variable - a is "char".
%  Class of variable - b is "double".
for i=1:length(a)
    b(i)=a(i)-48; %#ok<AGROW>
end

Contact us