Advertisement
mess0011

ue7_3

Dec 14th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. function result = u3()
  2. r = round(rand(4,6)*10)
  3. add = sum(r(:,1))
  4.  
  5.  
  6. if(add>305)
  7.     result = mean(r(:,5));
  8. elseif(add<295)
  9.     result = mean(r(:,4));
  10. elseif(305>add>295)
  11.     result = mean(r(:,6));
  12. end
  13.  
  14.  
  15. subplot(2,2,1); hist(r)
  16. subplot(2,2,2); hist(mean(r))
  17. subplot(2,2,3);maxW=max(r);hist(maxW)
  18. subplot(2,2,4);minW=min(r);hist(minW)
  19.  
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement