Specify the number of outputs and, optionally, the dimensionality of each output
port.
The value can be a scalar specifying the number of outputs or a vector whose elements
specify the widths of the block output ports. The block determines the size of its
outputs from the size of the input signal and the value of the Number of
outputs parameter.
If you specify a scalar for the Number of outputs parameter, and all
of the output ports are connected, as you draw a new signal line close to the output
side of a Demux block, the software adds a port and updates the
Number of outputs parameter.
For an input vector of width n, this table describes what the
block outputs.
| Parameter Value | Block Output | Examples and Comments |
|---|
p = n
| p scalar signals
| If the input is a three-element vector and you specify three outputs,
the block outputs three scalar signals. |
p > n
| Error | This value is not supported. |
p < n
n mod p =
0
| p vector signals each having
n/p elements
| If the input is a six-element vector and you specify three outputs,
the block outputs three two-element vectors. |
p < n
n mod p =
m
| m vector signals each having
(n/p)+1 elements and p-m signals
having n/p elements
| If the input is a five-element vector and you specify three outputs,
the block outputs two two-element vector signals and one scalar
signal. |
[p1
p2 ...
pm]
p1+p2+...+pm=n
pi
> 0
| m vector signals having widths
p1,
p2, ...
pm
| If the input is a five-element vector and you specify [3,
2] as the output, the block outputs three of the input elements on
one port and the other two elements on the other port. |
An array that has one or more of m elements with a value of
-1, which specifies that the software infers the size for
the element. For example, suppose that you have a four-element
array with a total width of 14 and you specify the parameter to be
[p1
p2 -1
p4]. The
value for the third element (the -1 element) is 14
- (p1 + p2
+ p4) | m vector signals
| If pi is greater than zero,
the corresponding output has width
pi. If
pi is -1, the width of the
corresponding output is computed dynamically. |
[p1
p2 ...
pm]
p1+p2+...+pm!=n
pi
= > 0
| Error | This value is not supported. |
If you specify a number of outputs that is smaller than the number of input elements, the
block distributes the elements as evenly as possible over the outputs.
Specifying
a nondouble value, such as single(3), is not
supported.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | Outputs |
| Values: | '2' (default) | scalar in quotes | vector in quotes |
| Data Types: | char | string |
Example: set_param(gcb,'Outputs','4')