The let command is used to assign vectors.
let [vecname [= expr]] [vecname = expr ...]With no arguments, the list of vectors from the current plot is printed, similar to the display command. If one or more arguments appear without an assignment, information about the named vectors is printed, similar to the display command. Otherwise, for each assignment, a vector is created with name vecname and value given by the expression expr.
In WRspice releases prior to 3.0.9, only a single assignment could appear in a let command. In current releases, any number of assignemnts can be given in a single command line. The assignments are performed left-to-right, so that expressions to the right of an assignment may make use of that assignment, i.e., forms like
let a=1 b=awork properly.
None of the vector options such as default scale, color, etc. that are read from the rawfile are preserved when a vector is created with the let command.
The syntax
let a[N] = vecwith N a non-negative integer, is valid. If vec is a vector, then a[N] = vec[0], a[N+1] = vec[1], etc., If undefined, a is defined, and new entries that are not explicitly set are zeroed. The length of a is set or modified to accommodate vec. The syntax a[0] = vec is also valid, and is equivalent to a = vec. If vec is a vector, then a is a copy of vec. If vec is a scalar (unit length vector), then a is also a scalar with the value of vec.
When assignment is from a scalar value, any SPICE number format may be used. That is, if alpha characters appear after a number, the initial characters are checked as a scale factor. Recognized sequences are t, g, k, u, n, p, f, m, meg, mil. Remaining characters are parsed as a units string. This is all case insensitive.
The units suffix of a constant value is used to assign the units of any vector to which the constant is assigned. This means, for example, in
let a = v(1)/15oa has units of current (A). Use the settype command without arguments to see a list of recognized types.
The ``let'' is actually optional; the let command will be applied to a line with the second token being ``=''. This is somewhat less efficient, however.