Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. Zadanie 1
  2.  
  3. >> cos(pi/3)+cot(asin(0.5))+(atan(0.3))^2
  4.  
  5. ans =
  6.  
  7. 2.3170
  8.  
  9. Zadanie 2
  10.  
  11. >> x=32*pi
  12.  
  13. x =
  14.  
  15. 100.5310
  16.  
  17. >> y=(cosh(x))^2 - (sinh(x))^2
  18.  
  19. y =
  20.  
  21. 0
  22.  
  23. Zadanie 3
  24.  
  25. >> A = (rand(4,5))*10
  26.  
  27. A =
  28.  
  29. Columns 1 through 4
  30.  
  31. 8.1472 6.3236 9.5751 9.5717
  32. 9.0579 0.9754 9.6489 4.8538
  33. 1.2699 2.7850 1.5761 8.0028
  34. 9.1338 5.4688 9.7059 1.4189
  35.  
  36. Column 5
  37.  
  38. 4.2176
  39. 9.1574
  40. 7.9221
  41. 9.5949
  42.  
  43. >> min(A)
  44.  
  45. ans =
  46.  
  47. 1.2699 0.9754 1.5761 1.4189 4.2176
  48.  
  49. >> max(A)
  50.  
  51. ans =
  52.  
  53. 9.1338 6.3236 9.7059 9.5717 9.5949
  54.  
  55.  
  56. Zadanie 5
  57.  
  58. >> x = [1 5 2 8 9 0 1] , y = [5 2 2 6 0 0 2]
  59.  
  60. x =
  61.  
  62. 1 5 2 8 9 0 1
  63.  
  64.  
  65. y =
  66.  
  67. 5 2 2 6 0 0 2
  68.  
  69. a) >> x > y
  70.  
  71. ans =
  72.  
  73. 0 1 0 1 1 0 0
  74.  
  75. >> x < y
  76.  
  77. ans =
  78.  
  79. 1 0 0 0 0 0 1
  80.  
  81. b) >> x == y
  82.  
  83. ans =
  84.  
  85. 0 0 1 0 0 1 0
  86.  
  87. >> x <= y
  88.  
  89. ans =
  90.  
  91. 1 0 1 0 0 1 1
  92.  
  93. c) >> x >= y
  94.  
  95. ans =
  96.  
  97. 0 1 1 1 1 1 0
  98.  
  99. >> x | y
  100.  
  101. ans =
  102.  
  103. 1 1 1 1 1 0 1
  104.  
  105. d) >> x & y
  106.  
  107. ans =
  108.  
  109. 1 1 1 1 0 0 1
  110.  
  111. >> y & x
  112.  
  113. ans =
  114.  
  115. 1 1 1 1 0 0 1
  116.  
  117. e) >> (x > y) | (y < x)
  118.  
  119. ans =
  120.  
  121. 0 1 0 1 1 0 0
  122.  
  123. >> (x > y) & (y < x)
  124.  
  125. ans =
  126.  
  127. 0 1 0 1 1 0 0
  128.  
  129. Zadanie 6
  130.  
  131. >> a = [4 5 7 0;2 10 12 24;32 2 3 5] , b = [3 8 7 0;34 3 12 18;20 5 1 5]
  132.  
  133. a =
  134.  
  135. 4 5 7 0
  136. 2 10 12 24
  137. 32 2 3 5
  138.  
  139.  
  140. b =
  141.  
  142. 3 8 7 0
  143. 34 3 12 18
  144. 20 5 1 5
  145.  
  146. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement