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.

output=octcheck(input)
function output=octcheck(input)

% This function keeps it same if its a valid number in this system.
output=input;
if ( sign(length(input-48)-sum(sign(abs(input-48+1)+(input-48+1))))+sign(sum(abs(input-48-7)+(input-48-7))) ) %#ok<BDLOG>
    output ='Invalid Number';
end

Contact us