Within array initializations, when a line ends with a comma, rather than an
ellipsis line continuation indicator (...
), MATLAB ignores
the comma and the new line takes precedence. Thus, MATLAB interprets a new line
as a new row. Your use of a comma suggests that you are trying to create a row
vector, rather than a column vector. This might not matter because row and
column vectors work the same way in many situations.
To specify a row vector, insert an ellipsis (...
) after the
comma at the end of the row. To specify a column vector, remove the comma or
replace it with a semicolon, so that your intentions are clear. If you prefer to
leave your code as is, then suppress the message or turn it off in the
preferences panel, as described in Adjust Code Analyzer Message Indicators and Messages.