%% Import Data from a GroupedData object
% Load a sample dataset.

load pheno ds

%
% Create a groupedData object.

grpData = groupedData(ds);

%
% Use the groupedData object variable names and define what column headings or variables mean according to the NONMEM definition.

def = sbionmfiledef;
def.GroupLabel = grpData.Properties.GroupVariableName;
def.TimeLabel = grpData.Properties.IndependentVariableName;
def.DependentVariableLabel = 'CONC';
def.DoseLabel = 'DOSE';
def.ContinuousCovariateLabels = {'WEIGHT', 'APGAR'};

%
% Import the dataset.

data = sbionmimport(grpData,def);

% Copyright 2012 The MathWorks, Inc.