{"id":20500289,"url":"https://github.com/ohno/matrixprintf.jl","last_synced_at":"2026-03-19T16:07:52.725Z","repository":{"id":156627778,"uuid":"502394141","full_name":"ohno/MatrixPrintf.jl","owner":"ohno","description":"using Printf.jl to each element of a matrix","archived":false,"fork":false,"pushed_at":"2022-06-13T08:29:02.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T08:58:38.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/ohno.png","metadata":{"files":{"readme":"README.ipynb","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-11T16:03:02.000Z","updated_at":"2022-06-18T17:05:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb4d40e8-4830-413b-b79e-edfca4f477f2","html_url":"https://github.com/ohno/MatrixPrintf.jl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ohno/MatrixPrintf.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohno%2FMatrixPrintf.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohno%2FMatrixPrintf.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohno%2FMatrixPrintf.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohno%2FMatrixPrintf.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohno","download_url":"https://codeload.github.com/ohno/MatrixPrintf.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohno%2FMatrixPrintf.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30200963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-15T18:20:24.826Z","updated_at":"2026-03-06T22:30:48.167Z","avatar_url":"https://github.com/ohno.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# MatrixPrintf\\n\",\n    \"\\n\",\n    \"[![Build Status](https://travis-ci.com/ohno/MatrixPrintf.jl.svg?branch=main)](https://travis-ci.com/ohno/MatrixPrintf.jl)\\n\",\n    \"[![Coverage](https://codecov.io/gh/ohno/MatrixPrintf.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ohno/MatrixPrintf.jl)\\n\",\n    \"[![Coverage](https://coveralls.io/repos/github/ohno/MatrixPrintf.jl/badge.svg?branch=main)](https://coveralls.io/github/ohno/MatrixPrintf.jl?branch=main)\\n\",\n    \"\\n\",\n    \"## Installation\\n\",\n    \"\\n\",\n    \"To add this package, run the following code in your Jupyter Notebook:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"\\u001b[32m\\u001b[1m    Updating\\u001b[22m\\u001b[39m git-repo `https://github.com/ohno/MatrixPrintf.jl.git`\\n\",\n      \"\\u001b[32m\\u001b[1m    Updating\\u001b[22m\\u001b[39m registry at `C:\\\\Users\\\\Shuhei\\\\.julia\\\\registries\\\\General.toml`\\n\",\n      \"\\u001b[32m\\u001b[1m   Resolving\\u001b[22m\\u001b[39m package versions...\\n\",\n      \"\\u001b[32m\\u001b[1m  No Changes\\u001b[22m\\u001b[39m to `C:\\\\Users\\\\Shuhei\\\\.julia\\\\environments\\\\v1.7\\\\Project.toml`\\n\",\n      \"\\u001b[32m\\u001b[1m  No Changes\\u001b[22m\\u001b[39m to `C:\\\\Users\\\\Shuhei\\\\.julia\\\\environments\\\\v1.7\\\\Manifest.toml`\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"using Pkg\\n\",\n    \"Pkg.add(path=\\\"https://github.com/ohno/MatrixPrintf.jl.git\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"or use `add` upon Pkg REPL:\\n\",\n    \"\\n\",\n    \"```julia\\n\",\n    \"]\\n\",\n    \"add https://github.com/ohno/MatrixPrintf.jl.git\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Usage\\n\",\n    \"\\n\",\n    \"To use this package, run the following code in your Jupyter Notebook or code:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"using MatrixPrintf\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Examples\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/plain\": [\n       \"2×2 Matrix{Float64}:\\n\",\n       \" 0.01     2.0\\n\",\n       \" 3.0   -400.0\"\n      ]\n     },\n     \"execution_count\": 3,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"A = [1 2;\\n\",\n    \"     3 4]\\n\",\n    \"\\n\",\n    \"B = [1  0;\\n\",\n    \"     0 -1]\\n\",\n    \"\\n\",\n    \"C = [0.01   2;\\n\",\n    \"     3.0 -400]\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {\n    \"scrolled\": false\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"### `msprintf(M)`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A)\\n\",\n      \"msprintf(B)\\n\",\n      \"msprintf(C)\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"[1.0 2.0;\\n\",\n      \" 3.0 4.0]\\n\",\n      \"[ 1.0  0.0;\\n\",\n      \"  0.0 -1.0]\\n\",\n      \"[   0.0    2.0;\\n\",\n      \"    3.0 -400.0]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\")`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\")\\n\",\n      \"msprintf(B, symbol=\\\"B\\\")\\n\",\n      \"msprintf(C, symbol=\\\"C\\\")\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [1.0 2.0;\\n\",\n      \"     3.0 4.0]\\n\",\n      \"B = [ 1.0  0.0;\\n\",\n      \"      0.0 -1.0]\\n\",\n      \"C = [   0.0    2.0;\\n\",\n      \"        3.0 -400.0]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\", digit=5)`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\", digit=5)\\n\",\n      \"msprintf(B, symbol=\\\"B\\\", digit=5)\\n\",\n      \"msprintf(C, symbol=\\\"C\\\", digit=5)\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [1.00000 2.00000;\\n\",\n      \"     3.00000 4.00000]\\n\",\n      \"B = [ 1.00000  0.00000;\\n\",\n      \"      0.00000 -1.00000]\\n\",\n      \"C = [   0.01000    2.00000;\\n\",\n      \"        3.00000 -400.00000]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\", digit=2)`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\", digit=2)\\n\",\n      \"msprintf(B, symbol=\\\"B\\\", digit=2)\\n\",\n      \"msprintf(C, symbol=\\\"C\\\", digit=2)\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [1.00 2.00;\\n\",\n      \"     3.00 4.00]\\n\",\n      \"B = [ 1.00  0.00;\\n\",\n      \"      0.00 -1.00]\\n\",\n      \"C = [   0.01    2.00;\\n\",\n      \"        3.00 -400.00]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\", digit=0)`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\", digit=0)\\n\",\n      \"msprintf(B, symbol=\\\"B\\\", digit=0)\\n\",\n      \"msprintf(C, symbol=\\\"C\\\", digit=0)\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [1 2;\\n\",\n      \"     3 4]\\n\",\n      \"B = [ 1  0;\\n\",\n      \"      0 -1]\\n\",\n      \"C = [   0    2;\\n\",\n      \"        3 -400]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\", format=\\\"%d\\\")`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\", format=\\\"%d\\\")\\n\",\n      \"msprintf(B, symbol=\\\"B\\\", format=\\\"%d\\\")\\n\",\n      \"msprintf(C, symbol=\\\"C\\\", format=\\\"%d\\\")\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [1 2;\\n\",\n      \"     3 4]\\n\",\n      \"B = [1 0;\\n\",\n      \"     0 -1]\\n\",\n      \"C = [0 2;\\n\",\n      \"     3 -400]\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"### `msprintf(M, symbol=\\\"M\\\", format=\\\"%8.1e\\\")`\\n\",\n      \"\\n\",\n      \"```julia:input\\n\",\n      \"msprintf(A, symbol=\\\"A\\\", format=\\\"%8.1e\\\")\\n\",\n      \"msprintf(B, symbol=\\\"B\\\", format=\\\"%8.1e\\\")\\n\",\n      \"msprintf(C, symbol=\\\"C\\\", format=\\\"%8.1e\\\")\\n\",\n      \"```\\n\",\n      \"\\n\",\n      \"```julia:output\\n\",\n      \"A = [ 1.0e+00  2.0e+00;\\n\",\n      \"      3.0e+00  4.0e+00]\\n\",\n      \"B = [ 1.0e+00  0.0e+00;\\n\",\n      \"      0.0e+00 -1.0e+00]\\n\",\n      \"C = [ 1.0e-02  2.0e+00;\\n\",\n      \"      3.0e+00 -4.0e+02]\\n\",\n      \"```\\n\",\n      \"\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"function table(title, codes...)\\n\",\n    \"    f(code) = eval(Meta.parse(code))\\n\",\n    \"    X = codes\\n\",\n    \"    Y = f.(X)\\n\",\n    \"    \\n\",\n    \"    println(\\\"### `$(title)`\\\")\\n\",\n    \"    println(\\\"\\\\n```julia:input\\\")\\n\",\n    \"    for row in X\\n\",\n    \"        println(replace(row, \\\" \\\"=\u003e\\\" \\\"))\\n\",\n    \"    end\\n\",\n    \"    println(\\\"```\\\")\\n\",\n    \"    println(\\\"\\\\n```julia:output\\\")\\n\",\n    \"    for row in Y\\n\",\n    \"        println(replace(row, \\\" \\\"=\u003e\\\" \\\"))\\n\",\n    \"    end\\n\",\n    \"    println(\\\"```\\\\n\\\")\\n\",\n    \"    \\n\",\n    \"end\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M)\\\",\\n\",\n    \"    \\\"msprintf(A)\\\",\\n\",\n    \"    \\\"msprintf(B)\\\",\\n\",\n    \"    \\\"msprintf(C)\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\")\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\", digit=5)\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\", digit=5)\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\", digit=5)\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\", digit=5)\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\", digit=2)\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\", digit=2)\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\", digit=2)\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\", digit=2)\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\", digit=0)\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\", digit=0)\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\", digit=0)\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\", digit=0)\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\", format=\\\\\\\"%d\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\", format=\\\\\\\"%d\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\", format=\\\\\\\"%d\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\", format=\\\\\\\"%d\\\\\\\")\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"table(\\\"msprintf(M, symbol=\\\\\\\"M\\\\\\\", format=\\\\\\\"%8.1e\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(A, symbol=\\\\\\\"A\\\\\\\", format=\\\\\\\"%8.1e\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(B, symbol=\\\\\\\"B\\\\\\\", format=\\\\\\\"%8.1e\\\\\\\")\\\",\\n\",\n    \"    \\\"msprintf(C, symbol=\\\\\\\"C\\\\\\\", format=\\\\\\\"%8.1e\\\\\\\")\\\"\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"`mprintf(M)` is same as `println(msprintf(M))`. If you want to get the return value as a string, use `msprintf(M)`. `format=\\\"\\\"` is the same as the first argument of `@sprintf` and `@printf`. For more information about `format=\\\"\\\"`, see [my article](https://zenn.dev/ohno/articles/8b35354a8140f8) or [the official documentation](https://docs.julialang.org/en/v1/stdlib/Printf/).\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Julia 1.7.1\",\n   \"language\": \"julia\",\n   \"name\": \"julia-1.7\"\n  },\n  \"language_info\": {\n   \"file_extension\": \".jl\",\n   \"mimetype\": \"application/julia\",\n   \"name\": \"julia\",\n   \"version\": \"1.7.1\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohno%2Fmatrixprintf.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohno%2Fmatrixprintf.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohno%2Fmatrixprintf.jl/lists"}