%% Specify Input-Output Data for Parameter Estimation
% Load the measured experiment data.

load sdoBattery_ExperimentData

% The variable Charge_Data, which contains the data measured during a battery charging experiment, is loaded into the MATLAB® workspace. The first column contains time data. The second and third columns contain the current and voltage data, respectively.
%
% Specify an experiment for a model.

modelname = 'sdoBattery';
exp = sdo.Experiment(modelname);
exp.Name = 'Charging';
exp.Description = 'Battery charging data collected on March 15, 2013.';

%
% Specify input data for the experiment.

exp.InputData = timeseries(Charge_Data(:,2),Charge_Data(:,1));

%
% Specify output data for the experiment.

VoltageSig = Simulink.SimulationData.Signal;
VoltageSig.Name      = 'Voltage';
VoltageSig.BlockPath = 'sdoBattery/SOC -> Voltage';
VoltageSig.PortType  = 'outport';
VoltageSig.PortIndex = 1;
VoltageSig.Values    = timeseries(Charge_Data(:,3),Charge_Data(:,1));

exp.OutputData = VoltageSig;

% Copyright 2015 The MathWorks, Inc.