A "big-data" alternative:
rows = 80; %// Number of rows
cols = 70; %// Number of columns
ch3 = 30; %// Number of elements in the 3rd dimension
ch4 = 200; %// Number of elements in the 4th dimension
%// number of 1's in each row. Select the appropriate class to make
%// sure peak memory remains acceptably small
intClasses = {'uint8' 'uint16' 'uint32' 'uint64'};
maxSizes = cellfun(@(x) double(intmax(x)), intClasses);
numOnes = randi(cols, rows*ch3*ch4,1, ...
intClasses{find(cols <= maxSizes, 1,'first')});
clear intClasses maxSizes
%// Loop through all rows and flip the appropriate number of bits
array = false(rows*ch3*ch4, cols);
for ii = 1:numel(numOnes)
array(ii,1:numOnes(ii)) = true; end
clear ii numOnes
%// Reshape into desired dimensions
array = reshape(array.', cols,rows,ch3,ch4);
array = permute(array, [2 1 3 4]);
clear rows cols ch3 ch4
(You could also use a sparse, but MATLAB only supports sparse for data of type double...In all probability, the logical array consumes less memory. If you're really desperate: the numOnes array alone contains sufficient information to retrieve either a 1 or 0; there's no need to construct the actual array. So, you could write a small wrapper class that implements the subsref in this way, basically, creating your own specific sparse that way :)
Note that this is a lot slower than Divakar's solution when the array is small. However, then the array sizes increase, this becomes progressively faster than Divakar's solution, with a lot smaller peak memory footprint.
EDIT: Divakar's bsxfun approach is the fastest of them all, however, it has O(N²) memory complexity. I.e., it only works if you can fit
`(cols-1)·rows²·ch3²·ch4² + (cols+1)·rows·ch3·ch4
(plus a few) 8-byte double values in your RAM, as opposed to just cols·rows·ch3·ch4 1-byte booleans for my method ^_^
As a simple comparison: re-running the same test as Divakar above, but within profile -memory:
Divakar's method:

My method:

As you can see, my method's peak memory equals the size of the output array (~130MB), while the overall speed the doesn't really suffer all that much, whereas Divakar's method has a memory footprint of 10× the output size (~1.4GB).