time interval and associated elapsed time

1 回表示 (過去 30 日間)
Seemab  Janjua
Seemab Janjua 2015 年 6 月 18 日
コメント済み: Seemab Janjua 2015 年 6 月 22 日
I have dataset of 1000 entries with date and magnitude column.i want to calculate the elapsed time between first hundred entries entry in days.same for second hundred enries,third hundred entries and so on ...

採用された回答

Walter Roberson
Walter Roberson 2015 年 6 月 18 日
groupsize = 100;
startdates = YourArray(1:groupsize:end,1);
enddates = YourArray(groupsize:groupsize:end,1);
elapsed = enddates - startdates;
The units will be the same as the units for your date information.
I suspect that what you want is instead
groupsize = 100;
startdates = YourArray(1:groupsize:end,1);
elapsed = diff(startdates);
That is, the first time would be the difference between the 101'st date and the 1'st date, then the 201's to the 101'st: the time difference between the blocks. What you asked is that the first one would be the 100'th to the 1'st, the 200th to the 101'st, so the difference within the block, not the difference between adjacent blocks.
  1 件のコメント
Seemab  Janjua
Seemab Janjua 2015 年 6 月 22 日
Thanks sir Walter Roberson.Sir this is my typing mistake and your suspect was right.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by