Make function reset for every interval/day

1 次查看(过去 30 天)
Hello,
I'm trying to make a loop where I want my function to reset it's calculation for every day. My array is sectioned into minutes.
So far I've made an array containing all index for every values my function needs to do it's calculation for e.g.:
di = [1 1 1 2 2 2 3 3 3 ] which corresponds to the three first days for three minutes. So I have every number repeating 60*24 times. I've used the unique function for creating this.
I have another array called t which is simply just values from a previous calculation.
First I want a function x = t*2 and I want it to reset this for each day, so every time a value in di changes.
Then I want it to cummulate all values in x for each time di changes it's value (1,2,3 ect.).
I know some have asked for similar questions (sorry) , but I cannot get their solutions to work.
I'm using Matlab2019a.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by