ReferenceselectFromSequence

<selectFromSequence>

<selectFromSequence> creates named variants from a user-defined range of numerical values.

Attributes and Properties

Attributes for <selectFromSequence>
AttributeTypeValues
asList = "…""true" "false"
assignNames = "…"
assignNamesSkip = "…"
displayDecimals = "…"
displayDigits = "…"
displaySmallAsZero = "…"
exclude = "…"
excludeCombinations = "…"
from = "…"
length = "…"
numToSelect = "…"integer
padZeros = "…"
sortResults = "…"boolean"true" "false"
step = "…"
to = "…"
type = "…""number" "math" "letters"
withReplacement = "…"boolean"true" "false"
Props for <selectFromSequence name="s">
PropertyType
$s.numToSelectinteger
$s.sortResultsboolean
$s.withReplacementboolean

Example: Default <selectFromSequence>

The default <selectFromSequence> has a sequence range from 11 to 1010.


Example: Generate and name multiple selections

Three numbers are selected between -5 and 5 (stepping in increments of 0.5) are assigned to the named variables x1, x2, and x3.


Example: numToSelect

The numToSelect attribute allows for selection of multiple values within the range of a single <selectFromSequence> component. Multiple selections are made without replacement.


Example: sortResults

The sortResults attribute sorts the selected results in increasing order.


Example: assignNames

The assignNames attribute takes a list of text values (which must meet DoenetML naming conventions ) for assigning names to individual selections.


Example: from, to

The from and to attributes specify the endpoints of the selction interval.


Example: step

The step attribute specifies the size of each increment in the sequence. The default step is 11


Example: exclude

The exclude attribute specifies values to exclude in the selection.


Example: withReplacement

If selection with replacement is the desired behavior, use the withReplacement attribute.


Example: excludeCombinations

The excludeCombinations attribute can be used to exclude unfavorable combinations of parameters. In this example, the exclusions have been designed to prevent the condition that the coefficients in the expression result in a sum of 00. Scroll through the page variants to observe the selections for each.


Example: type

The type attribute takes either letters or number as a text input. If unspecified, the default type is number.