I am trying to achieve a magnitude binary plot, where y shows the binary magnitude for the 8 bits. Others have addressed this question through plotting individual bits, but the goal to show the whole 8 bits, represented as one number (i.e. 00000001 = 1), magnitude in binary form on the plot.
Here is the code:
% Magnitude
binMag = [00000001; 00000010; 00000100]
% binary string representation of decimal 1, 2, 3
% Tried to convert bin to a double
binTodouble = str2double(binMag);
figure;
stairs(binTodouble)
Overall, my goal is to have a plot like the one below showing magnitude in binary.