How to change certain values of a column in a table depending on a certain time range ?

2 visualizaciones (últimos 30 días)
Hi there,
I have an array Total and then I created a timetable to combine them together.
t1 = datetime(2020,04,01, 0,0,0);
t2 = datetime(2020,04,01, 23,59,59);
Date = [t1:seconds(10):t2]' ;
T = table(Date,Total);
totalaggregated = table2timetable(T) ;
Now I want to replace the value in Total column ONLY for the following time range,
TR = timerange('2020-04-01 14:50:00','2020-04-01 15:10:00');
So that
Total = Total * 0.75
Can any one please help me how to do this ?
Thanks.
Regards,
Gayan

Respuesta aceptada

Tommy
Tommy el 13 de Abr. de 2020
Try this:
totalaggregated{TR,{'Total'}} = 0.75*totalaggregated{TR,{'Total'}};

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by