Vectors can be created with the let and compose commands.
Using the let command, a vector may be assigned the values of a vector already defined, or a floating-point number (a real scalar), or a comma separated pair of numbers (a complex scalar). A number may be written in any format acceptable to SPICE2, such as 14.6MEG or -1.231e-4. Note that one can use either scientific notation or one of the abbreviations like MEG or G (case insensitive), but not both. As with SPICE2, a number may have trailing alphabetic characters after it, which can indicate the units. If the vector being assigned to does not exist, it will be created.
The compose command can also be used to create vectors, and is useful for creating vectors with multiple points that follow some relationship, such as linear or logarithmic.
Newly-created vectors are added to the current plot, unless a plotname field is specified as part of the vector reference name. For example, entering
let constants.myvec = 2will assign a vector myvec in the constants plot the value 2.0. Entering
let myvec = constants.const_ewill assign a vector myvec in the current plot the values of the vector const_e in the constants plot. The let command without arguments will print a listing of vectors in the current plot.
Recent WRspice releases also allow vectors to be assigned a value with the set command. The syntax in this case is
set &vector = value
which is equivalent to
let vector = value
When entering this form from the WRspice command line, the `&' character must be hidden from the shell, perhaps most conveniently be preceding it with a backslash. The value must be numeric, and a value must be given, unlike normal usage of the set command which can set a variable as a boolean by omitting the right side of the assignment.