{"id":32171165,"url":"https://github.com/jat10/ex_matrix","last_synced_at":"2026-07-12T20:33:12.911Z","repository":{"id":62429185,"uuid":"124643437","full_name":"jat10/ex_matrix","owner":"jat10","description":"ExMatrix is a new Matrix library for Elixir. This library helps you to create a matrix, manipulate it with values and add/subtract two matrices.","archived":false,"fork":false,"pushed_at":"2018-03-11T18:04:43.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-27T20:08:28.171Z","etag":null,"topics":["elixir","elixir-matrix","elixir-plugin","matrix"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jat10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-10T10:02:07.000Z","updated_at":"2018-06-07T15:15:11.000Z","dependencies_parsed_at":"2022-11-01T20:03:33.310Z","dependency_job_id":null,"html_url":"https://github.com/jat10/ex_matrix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jat10/ex_matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jat10%2Fex_matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jat10%2Fex_matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jat10%2Fex_matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jat10%2Fex_matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jat10","download_url":"https://codeload.github.com/jat10/ex_matrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jat10%2Fex_matrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35402741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-matrix","elixir-plugin","matrix"],"created_at":"2025-10-21T17:43:35.224Z","updated_at":"2026-07-12T20:33:12.906Z","avatar_url":"https://github.com/jat10.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExMatrix\n\n![Elixir](https://img.shields.io/badge/Elixir-1.6-green.svg)\n[![Hex.pm](https://img.shields.io/badge/hex-v0.1.0-brightgreen.svg)](https://hex.pm/packages/ex_matrix)\n[![Read the Docs](https://img.shields.io/badge/Read%20the%20docs-v0.1-brightgreen.svg)](https://hexdocs.pm/ex_matrix/ExMatrix.html#content)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n`ExMatrix` is a new Matrix library for Elixir. This library helps you to create a matrix,\n`manipulate` it with values and `add/subtract` two matrices.\n\n## What is a Matrix\n\nA matrix is a collection of numbers arranged into a fixed number of rows and columns.\n\nHere is an example of a `3x2` matrix which means that we have `3 rows` and `2 columns`.\n\n```  \n        col 1  col 2\nrow 1 |  0      1   |\nrow 2 |  2      7   |\nrow 3 |  9      0   |\n``` \nThis is `row 2` \n\n```\n|  2      7   |\n```\n\nThis is `col 2`\n\n```\n  col 2\n|   1   |\n|   7   |\n|   0   |\n```\n\nTo get value from the above matrix we need to specify the row and colum that we need to get \nthe value from. The known syntax is `(number_of_rows,number_of_columns)` \n`(0,1) = 1` and `(2,0) = 9`\n\n## Installation\nFirst, add ExMatrix to your mix.exs dependencies:\n\n```elixir\ndef deps do\n  [\n    {:ex_matrix, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nThen, update your dependencies:\n\n```elixir\n$ mix deps.get\n```\n\n## Elixir Matrix\n\nSo to generate an elixir matrix you can use `ExMatrix.create(\"RowsxColumns\")` \nwill generate a map that can be used as a matrix\n\nBut note that `ExMatrix.create(...)` will generate an empty matrix as you can see in the example\n\n```elixir\n  iex\u003e matrix = ExMatrix.create(\"3x2\")\n  %{\"0\" =\u003e %{\"0\" =\u003e \"\", \"1\" =\u003e \"\"},\n    \"1\" =\u003e %{\"0\" =\u003e \"\", \"1\" =\u003e \"\"},\n    \"2\" =\u003e %{\"0\" =\u003e \"\", \"1\" =\u003e \"\"}\n  }\n```\n\nSo to fill this matrix with values you can use `ExMatrix.set_matrix(matrix,data)`\n\n```elixir\n  matrix = %{\"0\" =\u003e %{\"0\" =\u003e \"0\", \"1\" =\u003e \"1\"},\n             \"1\" =\u003e %{\"0\" =\u003e \"2\", \"1\" =\u003e \"7\"},\n             \"2\" =\u003e %{\"0\" =\u003e \"9\", \"1\" =\u003e \"0\"}\n            }\n```\nNow you can get values `matrix[\"0\"][\"1\"] = 1` and `matrix[\"2\"][\"0\"] = 9`.\n\n## Adding or Subtracting two matrices\n\nThere are many operation that you can apply on matrices and one of these operations is to add\nand subtract two matrices.\n\nSmall review on how we deal with addition and subtraction of two matrices:\n\n```\n   Matrix A     +      Matrix B     =     Result \n|  0      1   |   |  1      -1   |   |  1      0   |\n|  2      7   |   |  7      -2   |   |  9      5   |\n|  9      0   |   |  -1      8   |   |  8      8   |\n```\n\nYou can use `ExMatrix.add_matrices(matrix_1,matrix_2)` or `ExMatrix.sub_matrices(matrix_1,matrix_2)`  \n\n## Example Function\n\nIn case that there is something vague please use a helper function\n\n```elixir\n  iex\u003e ExMatrix.example(\"2x2\")\n  %{\"0\" =\u003e %{\"0\" =\u003e \"(0,0)\", \"1\" =\u003e \"(0,1)\"},\n    \"1\" =\u003e %{\"0\" =\u003e \"(1,0)\", \"1\" =\u003e \"(1,1)\"}\n  }\n```\n\n## What's Next\nThis library will be extend to have the ability to:\n1. Add or subtract two or more matrices\n1. Multiply and Divide two or more matrices\n1. Matrix Transpose\n\n\n## For contribution on GitHub\nPlease read the contribution requirements before start working\n\n\n## Copyright and License\n\nCopyright (c) 2018, Jad Tarabay.\n\nExMatrix source code is licensed under the [MIT License](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjat10%2Fex_matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjat10%2Fex_matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjat10%2Fex_matrix/lists"}