Command Reference : Matrix Language Reference
Syntax: @unitvector(n1, n2)
Argument 1: integer, n1
Argument 2: integer, n2
Return: vector
Creates an n1 element vector with a “1” in the n2-th element, and “0” elsewhere. Example:
vec v1 = @unitvector(8, 5)
creates an 8 element vector with a “1” in the fifth element and “0” for the other 7 elements. Note: if instead you wish to create a 10-element vector of ones, you should use a declaration statement of the form:
vector v1=@ones(10)
See also @ones.