Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
9
Task/Identity-matrix/Elixir/identity-matrix.ex
Normal file
9
Task/Identity-matrix/Elixir/identity-matrix.ex
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
defmodule Matrix do
|
||||
def identity(n) do
|
||||
Enum.map(0..n-1, fn i ->
|
||||
for j <- 0..n-1, do: (if i==j, do: 1, else: 0)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
IO.inspect Matrix.identity(5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue