Unstack Table Variables
Distribute values from one table variable to multiple table variables in the Live Editor
Description
The Unstack Table Variables task lets you interactively unstack, or distribute, values in a table or timetable from one variable to multiple variables. The task also automatically generates MATLAB® code for your live script.
To unstack variables means to distribute values from specified variables into multiple variables of the output. You must specify that one input variable is the indicator variable, whose unique values indicate the corresponding variables of the output. Other variables of the input can be grouping variables or constant variables, whose values determine the rows of the output. The diagram shows the result of unstacking a table using indicator and grouping variables.
For more information on Live Editor tasks, see Add Interactive Tasks to a Live Script.
Related Functions
Unstack Table Variables generates code that uses the
unstack function.
Open the Task
To add the Unstack Table Variables task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Unstack Table Variables.
Or, in a code block in the script, type a relevant keyword, such as
unstack. Select Unstack Table Variables from the suggested command completions.

