deal
Distribute multiple inputs to multiple outputs.
Syntax
Section titled “Syntax”[A, B, C, ...] = deal(X1, X2, X3, ...)[A, B, C, ...] = deal(X)Description
Section titled “Description”Assigns each input to the corresponding output. With multiple inputs, requires the same number of outputs. With a single input X, assigns X to every output. Useful for parallel multi-assignment from a varargout-returning function.
Examples
Section titled “Examples”[a, b, c] = deal(1, 2, 3) % a=1, b=2, c=3[a, b, c] = deal(0) % a=b=c=0See also
Section titled “See also”assign— Assign a value to a variable by name.