Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > p = matrix(c( 1,rep(0,7),
- + rep(0,2),1,rep(0,5),
- + rep(0,4),1,rep(0,3),
- + rep(0,6),1,rep(0,1),
- + rep(0,1),1,rep(0,6),
- + rep(0,3),1,rep(0,4),
- + rep(0,5),1,rep(0,2),
- + rep(0,7),1 ),8,8,1)
- > (v = c(1:8))
- [1] 1 2 3 4 5 6 7 8
- > as.vector(t(p %*% v))
- [1] 1 3 5 7 2 4 6 8
Add Comment
Please, Sign In to add comment