Problem 303. Convert Hard Drive marketing sizes to actual data sizes

Hard drive sizes are typically marketed using the decimal meaning of prefixes, whereas RAM uses binary meanings. For example:

A 10 GB hard drive (common only a few years ago) typically has 10,000,000,000 bytes 10 GB of RAM though is equal to 10,737,418,240 bytes

More information about this can be found here.

The problem is to take 2 inputs based upon decimal prefixes (a number representing size and a string representing the units) and output the equivalent size using binary prefixes, as seen below:

[100], 'MB' -> [95.4]
[100], 'GB' -> [93.1]

Solution Stats

26.44% Correct | 73.56% Incorrect
Last solution submitted on Oct 20, 2016

Problem Comments

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more