Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.30 KB | None | 0 0
  1. %totlu1
  2. %O7VX14
  3. meresiErtekek=randi([900,1090],4,3,31);
  4. resz1=squeeze(meresiErtekek(1,3,:));
  5. y=linspace(1,31,31);
  6. figure(1);
  7. plot(y,resz1, '-.ko','LineWidth', 3, 'MarkerSize', 11);
  8. h=find(resz1>=930&resz1<=1060);
  9. ertek=resz1(h);
  10. hold on;
  11. plot(h,ertek,'o', 'MarkerSize',15,'MarkerEdgeColor', 'red', 'MarkerFaceColor','green');
  12. hold off;
  13. title('elso szenzor, esti meres, mindennap','FontSize', 15);
  14. xlabel('napok szama', 'FontSize',13,'FontWeight','bold');
  15. ylabel('legkori nyomas [hPa] ', 'FontSize',13,'FontWeight','bold');
  16. xlim([1,31]);
  17. ylim([890,1100]);
  18. set(gca, 'FontSize', 15);
  19. xL=get(gca, 'XLim');
  20. line(xL,[930 930],'Color','m','LineWidth',2);
  21. line(xL,[1060 1060],'Color','m','LineWidth',2);
  22. k=resz1<=930 | resz1>=1060;
  23. resz1(k)=0;
  24. el=resz1(11:20);
  25. s=find(el>0);
  26. db=length(resz1(s));
  27. fprintf('Helyes meresi ertekek darabszama (elso szenzor, esti meres, 11­20. napokra): %0.0f \n', db);
  28. d2=squeeze(meresiErtekek(2,2,:));
  29. d3=squeeze(meresiErtekek(3,2,:));
  30. d4=squeeze(meresiErtekek(4,2,:));
  31. d2l=find(d2>=930 & d2<=1060);
  32. d2h=d2(d2l);
  33. atl2=mean(d2h);
  34. d3l=find(d3>=930 & d3<=1060);
  35. d3h=d3(d3l);
  36. atl3=mean(d3h);
  37. d4l=find(d4>=930 & d4<=1060);
  38. d4h=d4(d4l);
  39. atl4=mean(d4h);
  40. fprintf('A deli atlaga az elso szenzornak: %+09.3f, a masodiknak: %+09.3f es a harmadiknak: %+09.3f \n',atl2,atl3,atl4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement