checkConcatenateExpandedArray

Checks if brackets are used to concatenate struct array field values or object array property values. Performing concatenation on an expanded array is not supported by the Coder before MATLAB R2020b.

An example that will be reported:

s = struct("xCoordinate", {1, 3, 4});
x = [s.xCoordinate];

Instead use:

s = struct("xCoordinate", {1, 3, 4});
x = zeros(size(s)); 

for iX = 1 : numel(x) 
    x(iX) = s(iX).xCoordinate; 
end

Limitation

Dynamic field and property references are not reported, like:

s       = struct("xCoordinate", {1, 3, 4});
myField = "xCoordinate"; 
x       = [s.(myField)] 

Exemption tag: %@ok<CONAR>