필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
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

채택된 답변

Tommy
Tommy 2020년 4월 13일
Try this:
totalaggregated{TR,{'Total'}} = 0.75*totalaggregated{TR,{'Total'}};

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by