Like clojure.core/map, but will work on matrices of any dimension:
1 x 1 (like e.g. a Double), 1 x n, n x 1, and n x m
Examples:
(use '(incanter core))
(def mat (matrix (range 9) 3))
(matrix-map #(mod % 2) mat)
(matrix-map #(mod % 2) (first mat))
(matrix-map #(mod % 2) ($ 1 0 mat))
(matrix-map #(mod % 2) [1 2 3 4])
(matrix-map #(mod % 2) 9)
Comments top
No comments for matrix-map. Log in to add a comment.