Using the generateSi​mulationEn​semble in Predictive Maintenance Toolbox to generate a Time and Date

4 views (last 30 days)
Hi,
I am using the generateSimulationEnsemble in the Predictive Maintenance Toolbox to generate failure data. What I would like to do is setup an independant variable for the date information, so everytime the simulation runs I'm able to record the time and date.
IGBT.IndependentVariables = "Date";
I wondered how (if it's possible) I may set this up so for each simulation run, it records the time and the date as an independant variable? This is my code so far that works and shows the position of the ensemble.IndependentVariables = "Date";
IGBT=[mdl '/IGBT Full1'];'RC';
for ct = numel(Bondwire):-1:1
tmp = Simulink.SimulationInput(mdl);
tmp = setVariable(tmp,'IGBT',Bondwire(ct));
simin(ct)=tmp;
end
% Specify a location for the generated data.
mkdir Data
location = fullfile(pwd,'Data');
[status,E] = generateSimulationEnsemble(simin,location,'UseParallel',true);
ensemble = simulationEnsembleDatastore(fullfile(pwd,'Data'));
ensemble.DataVariables = ["VCE", "SimulationInput"];
% ensemble.IndependentVariables = "Date";
ensemble.SelectedVariables = ["VCE";"SimulationInput"]
tall(ensemble)
Kind regards,
Andy

Answers (0)

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!