Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{amsmath}
  3. usepackage{tikz}
  4.  
  5. %usepgfplotslibrary{external} %use with --shell-escape
  6. %tikzexternalize[prefix=Tikzplots/]
  7. %pgfplotsset{compat=newest}
  8.  
  9. makeatletter %vdots without extra space on top
  10. DeclareRobustCommand{rvdots}{%
  11. vbox{
  12. baselineskip4p@lineskiplimitz@
  13. kern-p@
  14. hbox{.}hbox{.}hbox{.}
  15. }}
  16. makeatother
  17.  
  18.  
  19. newcommandtikzmark[1]{% %nodes in matrix for lines
  20. tikz[overlay,remember picture,baseline] node [anchor=base] (#1) {};}
  21.  
  22. newcommandMyLine[3][]{% %draw lines between the nodes^
  23. begin{tikzpicture}[overlay,remember picture]
  24. draw[#1] (#2.north west) -- (#3.east);
  25. end{tikzpicture}}
  26.  
  27.  
  28.  
  29. begin{document}
  30.  
  31. [
  32. begin{bmatrix}
  33. Y[1]\
  34. phantom{0}\
  35. rvdots\
  36. rvdots\
  37. phantom{0}\
  38. Y[k]
  39. end{bmatrix}
  40. =
  41. begin{bmatrix}
  42. phantom{0}tikzmark{a} & phantom{0}& phantom{0}& phantom{0}&phantom{0}& phantom{0} \
  43. \
  44. \
  45. \
  46. \
  47. & & & & & tikzmark{b}phantom{0}
  48. end{bmatrix}
  49. cdot
  50. begin{bmatrix}
  51. X[1]\
  52. phantom{0}\
  53. rvdots\
  54. rvdots\
  55. phantom{0}\
  56. X[k]
  57. end{bmatrix}
  58. ]
  59.  
  60.  
  61.  
  62. [
  63. begin{bmatrix}
  64. Y[1]\
  65. phantom{0}\
  66. rvdots\
  67. rvdots\
  68. phantom{0}\
  69. Y[k]
  70. end{bmatrix}
  71. =
  72. begin{bmatrix}
  73. phantom{0}tikzmark{c} & phantom{0} &phantom{0}tikzmark{e} &phantom{0} & phantom{0}tikzmark{g}& phantom{0}\
  74. & & & & &tikzmark{h}phantom{0}\
  75. phantom{0}tikzmark{i}& & & & &\
  76. & & & & & tikzmark{f}phantom{0} \
  77. phantom{0}tikzmark{k}& & & & &\
  78. &tikzmark{l}phantom{0} & &tikzmark{j}phantom{0} & & tikzmark{d}phantom{0}\
  79. end{bmatrix}
  80. cdot
  81. begin{bmatrix}
  82. X[1]\
  83. phantom{0}\
  84. rvdots\
  85. rvdots\
  86. phantom{0}\
  87. X[k]
  88. end{bmatrix}
  89. ]
  90. MyLine[thick]{a}{b}
  91. MyLine[red,thick]{c}{d}
  92. MyLine[thick]{e}{f}
  93. MyLine[thick]{g}{h}
  94. MyLine[thick]{i}{j}
  95. MyLine[thick]{k}{l}
  96. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement