Decimal to Binary Conversion using MATLAB

This document provides MATLAB source code for converting decimal numbers to their binary equivalents. Specifically, it covers the dec2bin MATLAB function.

dec2bin Function

The dec2bin function takes a non-negative decimal integer as input and returns its binary representation as a string.

Syntax:

output = dec2bin(input);

Description:

The dec2bin function converts a non-negative decimal integer number to its binary string equivalent. The integer number argument should be less than 252.

Example:

input = 250;
output = dec2bin(input);
% Output will be: output = '11111010'