Stack Table Variables
Combine values from multiple table variables into one table variable in the Live Editor
Description
The Stack Table Variables task lets you interactively stack values from multiple table or timetable variables into one variable. The task automatically generates MATLAB® code for your live script.
Open the Task
To add the Stack Table Variables task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Stack Table Variables.
In a code block in the script, type a relevant keyword, such as
stack
ortable
. Select Stack Table Variables from the suggested command completions.
Parameters
Input table
— Names of table or timetable
drop-down list items
Specify the name of the input table or timetable timetables from the lists of all the nonempty tables and timetables that are in the workspace.
Variables to stack
— Actions for input variables
drop-down list items
Specify the action to take for each variable in the input table or timetable. When stacking variables, there are three possible actions:
Constant — Copy the variable to the output table or timetable. Replicate its values where needed in rows of the output.
Stack — Stack the values from the variable into one variable of the output. For example, if you choose to stack three variables, all their values go into one variable of the output.
Discard — Exclude the variable and its values from the output.