%% Create Symbolic Vectors
% Create a 1-by-4 symbolic vector a with the automatically generated elements a_1,\ldots,a_4. This command also creates the symbolic variables a1, ..., a4 in the MATLAB workspace.

syms a [1 4]
a
whos

% You can change the naming format of the generated elements by using a format character vector. Declare the symbolic variables by enclosing each variable name in single quotes. syms replaces %d in the format character vector with the index of the element to generate the element names.

syms 'p_a%d' 'p_b%d' [1 4]
p_a
p_b

%
% Copyright 2019 The MathWorks, Inc.