Borrar filtros
Borrar filtros

How to get a sum of coloumnn linked to datetime?

1 visualización (últimos 30 días)
Frank
Frank el 17 de Dic. de 2022
Comentada: Frank el 21 de Dic. de 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 :)

Respuesta aceptada

Peter Perkins
Peter Perkins el 19 de Dic. de 2022
Create a timetable from your data, and use retime to aggregate it to monthly. It's one line of code.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by