Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.41 KB | None | 0 0
  1. N = 250;
  2. x = floor(datenum(now))-100+(1:N)/10; % 10 mælingar á dag
  3. xd = datestr(x,'dddd');
  4. y = 20+10*cosd(360*x) + randi(10,1,N);
  5. xx = mod(x,1); % skiljum aukastafina eftir
  6. timabil = [12,13]; % 12:00-13:00
  7. dagur = 3; % þriðjudagur
  8. ind1 = xx >= timabil(1)/24 & xx <= timabil(2)/24;
  9. ind2 = weekday(x) == dagur;
  10. ind3 = ind1 & ind2;
  11. plot(x,y);
  12. hold on
  13. plot(x(ind3),y(ind3),'o');
  14.  
  15. ygaur = mean(y(ind3));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement