Effacer les filtres
Effacer les filtres

How to get a sum of coloumnn linked to datetime?

1 vue (au cours des 30 derniers jours)
Frank
Frank le 17 Déc 2022
Commenté : Frank le 21 Déc 2022
Hey Guys,
I got a .csv file and a stacked bar graph, right now the graph displays one value for every 15mins. I want to have a monthly view that shows the sum of all the values of the sum. My question is how do I convert the datetime into a MM/yyyy format and also sum up the values of that duration? I work in the appdesigner R2022b.
My code so far is:
function Bar_Monatliche_Erzeugung(app)
auswahl = [false false app.CheckBox.Value app.CheckBox2.Value app.CheckBox3.Value app.CheckBox4.Value app.CheckBox5.Value app.CheckBox6.Value app.CheckBox7.Value app.CheckBox8.Value app.CheckBox9.Value app.CheckBox10.Value app.CheckBox11.Value app.CheckBox12.Value];
for i = auswahl
if i == true
bar (app.UIAxes3, app.R.DatumUhrzeit,app.R{:,auswahl},'stacked');
end
end
if i == true
legend(app.UIAxes3,app.R.Properties.VariableNames(auswahl),'Location','northoutside');
app.UIAxes3.Title.String="Übersicht Monatliche Erzeugung";
app.UIAxes3.YLabel.String="Arbeit [MWh]";
app.UIAxes3.XLabel.String="Datum";
end
Thank you :)

Réponse acceptée

Peter Perkins
Peter Perkins le 19 Déc 2022
Create a timetable from your data, and use retime to aggregate it to monthly. It's one line of code.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by