If statements are not vectorized. The vectorized form of an if
uses a vector of booleans.
Something like this should work:
mask = (C{4} == 0);
A = struct('id',C{1}(mask), 'x', num2cell(C{2}(mask)), ...
'y', num2cell(C{3}(mask)), 'code', num2cell(C{4}(mask)));
B = struct('id',C{1}(~mask), 'x', num2cell(C{2}(~mask)), ...
'y', num2cell(C{3}(~mask)), 'code', num2cell(C{4}(~mask)));