Saving timetable for each iteration
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
In the code below, a simulink model runs 10 times and a table is extracted in each iteration and stored in the variable y. How do I save these tables in each iteration? (It would also be better if I could just write all of them off into one separate table).
for i=1:10
sampletime = iter(i);
simOut = sim("new_conflict_detect.slx");
y = timetable2table(ts2timetable(simOut.logsout{2}.Values));
end
Just for an idea, one of the tables looks like this:
0 Commenti
Risposta accettata
rakshit gupta
il 9 Lug 2023
tables = cell(1, 10);
for i = 1:10
sampletime = iter(i);
simOut = sim("new_conflict_detect.slx");
y = timetable2table(ts2timetable(simOut.logsout{2}.Values));
% Save the table in the cell array
tables{i} = y;
end
% Save the cell array as a .mat file
save('tables.mat', 'tables');
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!