%% LDPC Code Block Segmentation
% Create a random sequence of binary input data.

in = randi([0,1],4000,1);

% Perform LDPC code block segmentation.

cbs1 = nrCodeBlockSegmentLDPC(in,1); 
cbs2 = nrCodeBlockSegmentLDPC(in,2);

% When the base graph number is 1, the segmentation results in one code block segment. When the base graph number is 2, the segmentation results in two code block segments. Segmentation occurs only if the input length is greater than the maximum code block size. The maximum code block size is 8448 when the base graph number is 1 and 3840 when the base graph number is 2.

size(cbs1)
size(cbs2)

% Copyright 2019 The MathWorks, Inc.