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 automatically generates MATLAB® code for your live script. The generated code uses the unstack
function.
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.
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.