%% Unstack Table Variable Using Live Editor Task
% This example shows how to unstack values from one variable in an input table and distribute them to multiple variables in an output table by using the Unstack Table Variables Live Editor task.
% First, load a table that contains estimated influenza rates along the east coast of the United States. The table has a variable with flu rates and another variable indicating whether the rates are for the Northeast (NE), Mid-Atlantic (MidAtl), or Southeast (SE) regions. (These data come from the Google Flu Trends.)

load fluRate

%
%
% Add the Unstack Table Variables task to your live script. Unstack the Flu Rate variable so that the output table has variables named NE, MidAtl, and SE, containing flu rates for those regions.
% To group the data by month, select the Group by menu item below the Month variable in the task.
% To select the names of the output variables, click the radio button Names of new table variables above the Region variable. For each unique value in Region, there is a corresponding variable in the output table.
% To distribute values from the Flu Rate variable into the NE, MidAtl, and SE variables in the output, click the radio button Values in new table vaeiables above Flu Rate.
%
% Copyright 2019-2020 The MathWorks, Inc.