Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. A=[1 2 3;4 5 6; 7 8 9];
  2.  
  3. A =
  4.  
  5. 1 2 3
  6. 4 5 6
  7. 7 8 9
  8.  
  9. [m,n]=size(A)
  10.  
  11. m=3
  12. n=3
  13.  
  14. > x<-c(1:10)
  15. > x
  16. [1] 1 2 3 4 5 6 7 8 9 10
  17.  
  18. > A=matrix(0,10,10)
  19. > A=Toeplitz(x,c(x[1],rev(x[-1])))
  20. > A
  21.  
  22. [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  23. [1,] 1 10 9 8 7 6 5 4 3 2
  24. [2,] 2 1 10 9 8 7 6 5 4 3
  25. [3,] 3 2 1 10 9 8 7 6 5 4
  26. [4,] 4 3 2 1 10 9 8 7 6 5
  27. [5,] 5 4 3 2 1 10 9 8 7 6
  28. [6,] 6 5 4 3 2 1 10 9 8 7
  29. [7,] 7 6 5 4 3 2 1 10 9 8
  30. [8,] 8 7 6 5 4 3 2 1 10 9
  31. [9,] 9 8 7 6 5 4 3 2 1 10
  32. [10,] 10 9 8 7 6 5 4 3 2 1
  33.  
  34. > n=size(A)
  35. > n
  36. [1] 10 10
  37.  
  38. >[ m,n]=size(A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement