Hi, I need help in writing a code formula
古いコメントを表示
I'm writing a series of code which count total of activations, how long activated and time to next activation. I have so far managed the Start points and end points but i'm not sure how to go about get time between the points and time to start of next activation in time increments.
ATsyt2= T.ATSys.signals.values==2; % Channel
FATsyt2=find(ATsyt2==1); % Determine when condition is met
starATsyt2=FATsyt2([0; diff(FATsyt2)]>1); %Start of Activation
endFATsyt2=(starATsyt2-1);
endFATsyt2=endFATsyt2(2:end); % End of Activation
6 件のコメント
Walter Roberson
2019 年 3 月 24 日
Is this a timeseries with time stamps for each object? Is it a timeseries with start time and fixed interval? Is it just a regular struct with assumed fixed interval?
Franc
2019 年 3 月 24 日
Walter Roberson
2019 年 3 月 24 日
Then the associated times should be (starATsyt2(k):endFATsyt2(k)) * 0.1 or possibly 0.1 less than that (depending on whether the time of the first sample is 0.1 or 0.0).
arrayfun(@(start,stop) (start-1:stop-1)*0.1, starATsyt2, endFATsyt2, 'uniform', 0)
Franc
2019 年 3 月 24 日
Walter Roberson
2019 年 3 月 24 日
Is an activation a sequence of consecutive entries in which the signal value is exactly 2 ?
Franc
2019 年 3 月 24 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!