Logo

Programming-Idioms

History of Idiom 26 > diff from v49 to v50

Edit summary for version 50 by Alexander:
[Clojure] Fix typo in explanation

Version 49

2019-02-16, 07:49:34

Version 50

2019-02-16, 07:50:15

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration
Code
(for [r (range m)]
  (for [c (range n)]
    1.0))
Code
(for [r (range m)]
  (for [c (range n)]
    1.0))
Comments bubble
Matrix m by n matrix filled with the number 1.0
Comments bubble
Creates an m by n matrix filled with the number 1.0