I want to add binary numbers randomly in a cell array. How to do it?
1 view (last 30 days)
Johannes Hougaard on 29 Jul 2021
I can't really get the desired output from Marcels comment. Maybe if you add it to a for loop it'll be feasible.
However I think this will do the trick
maxnum = 1024;
rowno = 10;
colno = 9;
C = cellfun(@dec2bin,num2cell(randi(maxnum,rowno,colno)),'UniformOutput',false);