Advertisement
Guest User

789789

a guest
Nov 19th, 2019
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.84 KB | None | 0 0
  1. >> [pie*ones(1,5);ones(1,5);zeros(1,5):ones(1,5)]
  2. Error using pie (line 65)
  3. Not enough input arguments.
  4.  
  5. >> [pi*ones(1,5);ones(1,5);zeros(1,5):ones(1,5)]
  6. Error using vertcat
  7. Dimensions of arrays being concatenated are not consistent.
  8.  
  9. >> [pi*ones(1,5);ones(1,5);zeros(1,5);ones(1,5)]
  10.  
  11. ans =
  12.  
  13. 3.1416 3.1416 3.1416 3.1416 3.1416
  14. 1.0000 1.0000 1.0000 1.0000 1.0000
  15. 0 0 0 0 0
  16. 1.0000 1.0000 1.0000 1.0000 1.0000
  17.  
  18. >> format rat
  19. >> [pi*ones(1,5);ones(1,5);zeros(1,5);ones(1,5)]
  20.  
  21. ans =
  22.  
  23. 355/113 355/113 355/113 355/113 355/113
  24. 1 1 1 1 1
  25. 0 0 0 0 0
  26. 1 1 1 1 1
  27.  
  28. >> format short
  29. >> [pi*ones(1,5);ones(1,5);zeros(1,5);ones(1,5)]
  30.  
  31. ans =
  32.  
  33. 3.1416 3.1416 3.1416 3.1416 3.1416
  34. 1.0000 1.0000 1.0000 1.0000 1.0000
  35. 0 0 0 0 0
  36. 1.0000 1.0000 1.0000 1.0000 1.0000
  37.  
  38. >> eye(3)*5
  39.  
  40. ans =
  41.  
  42. 5 0 0
  43. 0 5 0
  44. 0 0 5
  45.  
  46. >> eye
  47.  
  48. ans =
  49.  
  50. 1
  51.  
  52. >> eye*sqrt
  53. Error using sqrt
  54. Not enough input arguments.
  55.  
  56. >> eye*sqrt(4)
  57.  
  58. ans =
  59.  
  60. 2
  61.  
  62. >> [sqrt(2)*ones(3)]
  63.  
  64. ans =
  65.  
  66. 1.4142 1.4142 1.4142
  67. 1.4142 1.4142 1.4142
  68. 1.4142 1.4142 1.4142
  69.  
  70. >> [sqrt(2)*ones(3)]
  71.  
  72. ans =
  73.  
  74. 1.4142 1.4142 1.4142
  75. 1.4142 1.4142 1.4142
  76. 1.4142 1.4142 1.4142
  77.  
  78. >> format short
  79. >> [sqrt(2)*ones(3)]
  80.  
  81. ans =
  82.  
  83. 1.4142 1.4142 1.4142
  84. 1.4142 1.4142 1.4142
  85. 1.4142 1.4142 1.4142
  86.  
  87. >> [sqrt(2)*ones(3)[2*eye(3),zeros(3,2)ones(1,5)]
  88. [sqrt(2)*ones(3)[2*eye(3),zeros(3,2)ones(1,5)]
  89. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  90.  
  91. >> [2*eye(3),zeros(3,2)ones(1,5)]
  92. [2*eye(3),zeros(3,2)ones(1,5)]
  93. Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct
  94. matrices, use brackets instead of parentheses.
  95.  
  96. Did you mean:
  97. >> [2*eye(3),zeros(3,2)*ones(1,5)]
  98. Error using *
  99. Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second
  100. matrix. To perform elementwise multiplication, use '.*'.
  101.  
  102. >> [2*eye(3),zeros(3,2);ones(1,5)]
  103.  
  104. ans =
  105.  
  106. 2 0 0 0 0
  107. 0 2 0 0 0
  108. 0 0 2 0 0
  109. 1 1 1 1 1
  110.  
  111. >> eye(3,4)
  112.  
  113. ans =
  114.  
  115. 1 0 0 0
  116. 0 1 0 0
  117. 0 0 1 0
  118.  
  119. >> b(3,4)
  120. Undefined function or variable 'b'.
  121.  
  122. >> d
  123. Undefined function or variable 'd'.
  124.  
  125. >> ad
  126. Undefined function or variable 'ad'.
  127.  
  128. >> d
  129. Undefined function or variable 'd'.
  130.  
  131. >> A=(3,4)
  132. A=(3,4)
  133. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  134.  
  135. >> spencerandagan@yahoo.com
  136. 'yahoo.com' is not a valid base class.
  137.  
  138. >> gg angnato
  139. Undefined function or variable 'gg'.
  140.  
  141. >> rekta singko
  142. Undefined function or variable 'rekta'.
  143.  
  144. >> haahaha joke
  145. Undefined function or variable 'haahaha'.
  146.  
  147. >> magic(3),pascal(3)
  148.  
  149. ans =
  150.  
  151. 8 1 6
  152. 3 5 7
  153. 4 9 2
  154.  
  155.  
  156. ans =
  157.  
  158. 1 1 1
  159. 1 2 3
  160. 1 3 6
  161.  
  162. >> A(3,4)magic(3),pascal(3)
  163. A(3,4)magic(3),pascal(3)
  164. Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct
  165. matrices, use brackets instead of parentheses.
  166.  
  167. Did you mean:
  168. >> A(3,4)*magic(3), pascal(3)
  169. Undefined function or variable 'A'.
  170.  
  171. >> A=(3,4)*magic(3), pascal(3)
  172. A=(3,4)*magic(3), pascal(3)
  173. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  174.  
  175. >> (3,4)*magic(3), pascal(3)
  176. (3,4)*magic(3), pascal(3)
  177. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  178.  
  179. >> A=(3,4)B=*magic(3), pascal(3)
  180. A=(3,4)B=*magic(3), pascal(3)
  181. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  182.  
  183. >> A=*(3,4)*magic(3), pascal(3)
  184. A=*(3,4)*magic(3), pascal(3)
  185. Error: Invalid use of operator.
  186.  
  187. >> A[2,1]
  188. A[2,1]
  189. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  190.  
  191. >> A[3;4],1:2]
  192. A[3;4],1:2]
  193. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  194.  
  195. >> A = magic(3)
  196.  
  197. A =
  198.  
  199. 8 1 6
  200. 3 5 7
  201. 4 9 2
  202.  
  203. >> B = pascal (3)
  204.  
  205. B =
  206.  
  207. 1 1 1
  208. 1 2 3
  209. 1 3 6
  210.  
  211. >> a=[A,B]
  212.  
  213. a =
  214.  
  215. 8 1 6 1 1 1
  216. 3 5 7 1 2 3
  217. 4 9 2 1 3 6
  218.  
  219. >> eye(3)*5
  220.  
  221. ans =
  222.  
  223. 5 0 0
  224. 0 5 0
  225. 0 0 5
  226.  
  227. >> a(3,4)
  228.  
  229. ans =
  230.  
  231. 1
  232.  
  233. >> [a(1,1)a(1,6);a(3,1),a(3,6)]
  234. [a(1,1)a(1,6);a(3,1),a(3,6)]
  235. Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct
  236. matrices, use brackets instead of parentheses.
  237.  
  238. Did you mean:
  239. >> [a(1,1)*a(1,6); a(3,1), a(3,6)]
  240. Error using vertcat
  241. Dimensions of arrays being concatenated are not consistent.
  242.  
  243. >> [a(1,1) a(1,6); a(3,1), a(3,6)]
  244.  
  245. ans =
  246.  
  247. 8 1
  248. 4 6
  249.  
  250. >> [a(3,1), a(3,2), a(3,3), a(3,4), a(3,5), a(3,6)]
  251.  
  252. ans =
  253.  
  254. 4 9 2 1 3 6
  255.  
  256. >> [a(1,3); a(2,3); a(3,3)]
  257.  
  258. ans =
  259.  
  260. 6
  261. 7
  262. 2
  263.  
  264. >> a(:,3)
  265.  
  266. ans =
  267.  
  268. 6
  269. 7
  270. 2
  271.  
  272. >> [a(1,1); a(1,2); a(3,3)]
  273.  
  274. ans =
  275.  
  276. 8
  277. 1
  278. 2
  279.  
  280. >> awit
  281. Undefined function or variable 'awit'.
  282.  
  283. >> diag(A)
  284.  
  285. ans =
  286.  
  287. 8
  288. 5
  289. 2
  290.  
  291. >> a(3,4)
  292.  
  293. ans =
  294.  
  295. 1
  296.  
  297. >> diag(diag(a)
  298. diag(diag(a)
  299. Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
  300.  
  301. Did you mean:
  302. >> diag(diag(a))
  303.  
  304. ans =
  305.  
  306. 8 0 0
  307. 0 5 0
  308. 0 0 2
  309.  
  310. >> A=[sqrt(5),i,2*sqrt(3);-3/4,0,1;1/-3,4i,-i]
  311.  
  312. A =
  313.  
  314. 2.2361 + 0.0000i 0.0000 + 1.0000i 3.4641 + 0.0000i
  315. -0.7500 + 0.0000i 0.0000 + 0.0000i 1.0000 + 0.0000i
  316. -0.3333 + 0.0000i 0.0000 + 4.0000i 0.0000 - 1.0000i
  317.  
  318. >> format rat
  319. >> A=[sqrt(5),i,2*sqrt(3);-3/4,0,1;1/-3,4i,-i]
  320.  
  321. A =
  322.  
  323. 2889/1292 + 0i 0 + 1i 1351/390 + 0i
  324. -3/4 + 0i 0 + 0i 1 + 0i
  325. -1/3 + 0i 0 + 4i 0 - 1i
  326.  
  327. >> format short
  328. >> A=[sqrt(5),i,2*sqrt(3);-3/4,0,1;1/-3,4i,-i]
  329.  
  330. A =
  331.  
  332. 2.2361 + 0.0000i 0.0000 + 1.0000i 3.4641 + 0.0000i
  333. -0.7500 + 0.0000i 0.0000 + 0.0000i 1.0000 + 0.0000i
  334. -0.3333 + 0.0000i 0.0000 + 4.0000i 0.0000 - 1.0000i
  335.  
  336. >> B=[4*2,2/3;1/201,5-8.2;0.0001,(9+4)/3]
  337.  
  338. B =
  339.  
  340. 8.0000 0.6667
  341. 0.0050 -3.2000
  342. 0.0001 4.3333
  343.  
  344. >> a=[A,B]
  345.  
  346. a =
  347.  
  348. 2.2361 + 0.0000i 0.0000 + 1.0000i 3.4641 + 0.0000i 8.0000 + 0.0000i 0.6667 + 0.0000i
  349. -0.7500 + 0.0000i 0.0000 + 0.0000i 1.0000 + 0.0000i 0.0050 + 0.0000i -3.2000 + 0.0000i
  350. -0.3333 + 0.0000i 0.0000 + 4.0000i 0.0000 - 1.0000i 0.0001 + 0.0000i 4.3333 + 0.0000i
  351.  
  352. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement