vsubc

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 17:31, 18 November 2010 by Admin (talk | contribs) (1 revision: Initial import)
Jump to navigationJump to search
vsubc

Conditional extraction of elements from the vector x.

Usage:

vsubc(x1,c,s1,x2)

vsubc(x1,c,s1,s2,x2)

Parameters:
x1
The input vector.
c
The condition. The following values are supported:
0 - select all x[i] where x[i] < s1
1 - select all x[i] where x[i] > s1
2 - select all x[i] where s1 < x[i] < s2
s1
A real number. See c for details.
s2
A real number (only used if c==2). See c for details.
x2
x2 is optional. If specified, the elements in x2 are extracted based on the selected values in x1. x2 must be a vector with exactly the same number of rows as x1.
Result:

The result is a scalar or a vector with the selected elements from x1 (or x2 - see x2 for details).

Navigation menu

Personal tools