use of for loop for time shift

1 次查看(过去 30 天)
aa
aa 2020-8-14
I have a data set in two coloums, time and number of events. for every time we have to pick teh crossponding value from second coloumn. I did this by for loop at initial stage. Now I want to pick the number of events in two hours with a shift of one hours. For example, 1-2, 2-3,3-4,4-5 hour.
May someone help me here.
Thank you
  2 个评论
Sara Boznik
Sara Boznik 2020-8-14
Maybe will be good if you send us the data.
If I correctly understand you, you need only the pick number like 1 2 3 and not 0.5, 1.5 ...
Some idea would be that you use
if rem(num,1)==0
For more I need your task.
Wish you best of luck.
Rafael Hernandez-Walls
If you have this data,
n=10;
x=[1:n]';y=[1:n]';
% shift of one hours
[x(1:n-1) y(2:n)]

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by