Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Tommy
Tommy le 13 Avr 2020
Try this:
totalaggregated{TR,{'Total'}} = 0.75*totalaggregated{TR,{'Total'}};

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by