function binaryNumber = myDec2Bin(decimalNumber)

% Initialize:
binaryNumber = [];
i = 1;

% Keep looping until the number is geq to 1
while( decimalNumber >= 1 )
    % compute the remainder and store it:
    binaryNumber( i ) = rem( decimalNumber, 2 );
    % update the decimal number:
    decimalNumber = floor( decimalNumber/2 );
    i = i+1;
end
% Flip the array to present the binary number in the right order:
binaryNumber = binaryNumber(end:-1:1);