Create a 1-by-4 symbolic vector a with the automatically generated elements a 1 , … , a 4 . This command also creates the symbolic variables a1 , ..., a4 in the MATLAB workspace.

syms a [1 4] a

a = ( a 1 a 2 a 3 a 4 ) [a1, a2, a3, a4]

whos

Name Size Bytes Class Attributes a 1x4 8 sym a1 1x1 8 sym a2 1x1 8 sym a3 1x1 8 sym a4 1x1 8 sym

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_a = ( p a1 p a2 p a3 p a4 ) [p_a1, p_a2, p_a3, p_a4]

p_b