MATLAB: How can we plot a 256-bit array at a particular value on x-axis

functionplot

Hii,
i am trying to plot a 256-bit array (1 row and 256 cloumns)at a particular instance on x-axis. row represents the x-axix and column represents the y-axis.It has to show all the 256-bits as a stack along with y-axix and also represents the 256-bits with the samples on y-axis. Please help me out of this.
thank you in advance.

Best Answer

I'm not completely sure I understand. Maybe this is what you want:
bitarray = randi([0 1], 10, 256); %random array of 10 256-bit values
figure;
[row, column] = find(bitarray);
scatter(row, 256 - column, '.', 'DisplayName', 'On bits');
ylim([0 255]);
legend('show', 'Location', 'southoutside');