[Question]
  [
You're given a **n-by-m** matrix of integers, where **n,m > 3**. Your task is to find the **3-by-3** sub-matrix that has the lowest mean, and output this value.
**Rules and clarifications:**
* The integers will be non-negative
* Optional input and output format
* The output must be accurate up to at least 2 decimal poins (if it's non-integer)
* The submatrices must be made up of consecutive rows and columns
**Test cases:**
```
35    1    6   26   19   24
 3   32    7   21   23   25
31    9    2   22   27   20
 8   28   33   17   10   15
30    5   34   12   14   16
 4   36   29   13   18   11 
Minimum mean: 14
```
---
```
100    65     2    93
  3    11    31    89
 93    15    95    65
 77    96    72    34
Minimum mean: 46.111
```
---
```
1   1   1   1   1   1   1   1
1   1   1   1   1   1   1   1
1   1   1   1   1   1   1   1
1   1   1   1   1   1   1   1
Minimum mean: 1
```
---
```
4   0   0   5   4
4   5   8   4   1
1   4   9   3   1
0   0   1   3   9
0   3   2   4   8
4   9   5   9   6
1   8   7   2   7
2   1   3   7   9
Minimum mean: 2.2222
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code in each language wins. I encourage people to post answers in languages that are already used, even if it's not shorter than the first one.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~11~~ 9 bytes
```
+3\⁺€F÷9Ṃ
```
Saved 2 bytes thanks to @[Dennis](https://codegolf.stackexchange.com/users/12012/dennis).
[Try it online!](https://tio.run/nexus/jelly#rVGxEcIwDOyZwj0uLMtxogVYwngY0rAMPQdtJoFFwr/jHHfU3Em29HrprWQ96vl9eb7n22m52@sxr8sVybqWUnTwTrzL3kW4GO5UvSvqnUbvRuQoR6RxaDgykmB01gPxCQFcQRSAEuBbAyJoaAKADuGdWUCglMU0YRe6RWr1B1eKBHTloemY9vcIpCk/GQEjAoYNZBIZoWuYOEbK7ZPaer9G@h8rmxQWCs3wotQ3RIi90rc9tc@nHdj40gDrgLatwZv6DGtjcOY@Y9r@C04CcR/A9WutHw)
## Explanation
```
+3\⁺€F÷9Ṃ  Main link. Input: 2d matrix
+3\        Reduce overlapping sublists of size 3 by addition
   ⁺€      Repeat previous except over each row
     F     Flatten
      ÷9   Divide by 9
        Ṃ  Minimum
```
[Answer]
# Octave, 30 bytes
```
@(A)min(mean(im2col(A,[3,3])))
```
[Try it online!](https://tio.run/nexus/octave#JY5LCoAwDET3OUWWLUixRq1FBHsOcSGiINi68P7UJmbxyEw@TJ5V0PFKKh5bUlds9udWoVqoolVrnc9pS@8IASdcjDFg6xpL9R0TG4YnQCTurGWScPBQJuLKru/@O0DnRPdMJx@oXUc4S5D8AQ "Octave – TIO Nexus")
[Answer]
# Octave, 38 bytes
```
@(M)min(conv2(M,ones(3)/9,'valid')(:))
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~13~~ 9 bytes
```
3thYCYmX<
```
Port of [@rahnema1's answer](https://codegolf.stackexchange.com/a/109100/36398).
[Try it online!](https://tio.run/nexus/matl#DcmxDYAwDADBVX6EOCYxlulYgiiip6Fjf5PydKnfM87xXkfmlFLoDSqugSKCCrvHMtLwtjowwztW0e3@AQ "MATL – TIO Nexus")
### How it works
Consider input
```
[100 65  2 93;
   3 11 31 89;
  93 15 95 65;
  77 96 72 34]
```
as an example.
```
3th   % Push [3 3]
      % STACK: [3 3]
YC    % Input matrix implicitly. Convert 3x3 sliding blocks into columns
      % STACK: [100   3  65  11;
                  3  93  11  15;
                 93  77  15  96;
                 65  11   2  31;
                 11  15  31  95;
                 15  96  95  72;
                  2  31  93  89;
                 31  95  89  65;
                 95  72  65  34]
Ym    % Mean of each column
      % STACK: [46.1111 54.7778 51.7778 56.4444]
X<    % Minimum of vector. Display implicitly
      % STACK: [46.1111]
```
[Answer]
# Mathematica, ~~37~~ 35 bytes
Thanks @MartinEnder for 2 bytes!
```
Min@BlockMap[Mean@*Mean,#,{3,3},1]&
```
**Explanation**
```
Min@BlockMap[Mean@*Mean,#,{3,3},1]&
    BlockMap[                    ]&  (* BlockMap function *)
                        #            (* Divide the input *)
                          {3,3}      (* Into 3x3 matrices *)
                                1    (* With offset 1 *)
             Mean@*Mean              (* And apply the Mean function twice to
                                        each submatrix *)
Min                                  (* Find the minimum value *)
```
[Answer]
# [J](http://jsoftware.com/), 21 bytes
```
[:<./@,9%~3+/\3+/\"1]
```
[Try it online!](https://tio.run/nexus/j#FYxNCsJAFIP3nuJDcKXYyXvt9EcF72GLC7G4GbyBVx9fIcniS0hduU08puu5uZ/Gw8@Pzbx5r6WWrXpmlhnvEBnLaMRaHDd6TJhjHS6CY6GgiQEbcEc9SigGiYgWGYrMxEf8jShGA9Lu/fp8KZeVUv8)
The proper way to operate on subarrays in J is to use the third (`_3`) form of cut `;.` where `x (u;._3) y` means to apply verb `u` on each full subarray of size `x` of array `y`. A solution using that requires only 1 more byte but will be much more efficient on larger arrays.
```
[:<./@,9%~3 3+/@,;._3]
```
[Try it online!](https://tio.run/nexus/j#FYxBCsJAFEP3nuJtXCl18n877bQK3kNLF2JxM3iDXr1@IYSQPLKv3EYe47W53M/luDl@ijQ1i897/W9LZn7iHSJjGRWsJTijx4Q51uEieiwUbWLABtxRjxIKIBHWIkPhmfiIv4ICGpAO79fnS51W6v4D)
## Explanation
```
[:<./@,9%~3+/\3+/\"1]  Input: 2d array M
                    ]  Identity. Get M
                  "1   For each row
              3  \       For each overlapping sublist of size 3
               +/          Reduce by addition
          3  \         For each overlapping 2d array of height 3
           +/            Reduce by addition
       9%~             Divide by 9
[:    ,                Flatten it
  <./@                 Reduce by minimum
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~93~~ ~~81~~ ~~80~~ 79 bytes
```
f=lambda M:M[2:]and min(sum(sum(zip(*M[:3])[:3],()))/9,f(M[1:]),f(zip(*M)[1:]))
```
[Try it online!](https://tio.run/nexus/python2#xVM7boQwFKzhFK9ZrR0h4g9gjJQjcAJEsdEKCSmQ1SZpcnkC89ZGpEmZgpHfb2YemGV4ebtMr9cLtU3bmaa/zFeaxll8fE14vsebeGq7xvZyg0xIKZ99Noi2000v1wN3SIRyGd7v1NI4k0iTTtgyVxmRBlYbGqD2OBe5klmakCC7xdagz6GGGYO8KUOfZSZME7oNI8@oyFcjBlpwaHRoBdz5EBNc2gI18Gk@V5EPseUNoK6ZFQp6dSX7bFtYKzBW5e7Q28jCa2oswavUPha9Dd7WmTKwPIoO9j0MOBPsBlEM/gXM9M@9bBhvU0XAsvEuFDFVP/K/ZZDCV7CH4s6oY9EfinydIkd90PRRGKfqoAkvLo67UDRHORc0e9mkye0@zp90Prm8GM50ovWvkcsP "Python 2 – TIO Nexus")
### How it works
**f** is a recursive function that takes a list of tuples (or any other indexable 2D iterable that represents a matrix **M**) and recursively computes the minimum of the mean of the **3×3** submatrix in the upper left corner and **f** applied recursively to **M** without its first row and **M** without its first column.
`f(M)` does the following.
* If **M** has less than three rows, `M[2:]` is an empty list, which **f** returns.
Note that, since **n > 3** in the first run, the initial cannot cannot return an empty list.
* If **M** has three rows or more, `M[2:]` is non-empty and thus truthy, so the code to the right of `and` gets executed, returning the minimum of the three following values.
```
min(sum(sum(zip(*M[:3])[:3],()))/9
```
`M[:3]` yields the first three rows of **M**, `zip(*...)` transposes rows and columns (yielding a list of tuples), `sum(...,())` concatenates all tuples (this works because `+` is concatenation), and `sum(...)/9` computes the mean of the resulting list of nine integers.
```
f(M[1:])
```
recursively applies **f** to **M** with its first row removed.
```
f(zip(*M)[1:])
```
transposes rows and columns, removes the first row of the result (so the first column of **M**, and recursively applies **f** to the result.
Note that the previously removed layer in a recursive call will always be a row, so testing if **M** has enough rows will always be sufficient..
Finally, one may expect that some recursive calls returning `[]` would be a problem. However, in Python *2*, whenever **n** is a number and **A** is an iterable, the comparison `n < A` returns *True*, so computing the minimum of one or more numbers and one or more iterables will always return the lowest number.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
*Missed the trick, as used by miles in their [answer](https://codegolf.stackexchange.com/a/109096/53748), of using an n-wise cumulative reduce of addition - the whole first line can be replaced with `+3\` for 11.*
```
ẆµL=3µÐfS€
ÇÇ€FṂ÷9
```
[Try it online!](https://tio.run/nexus/jelly#HYsxEkAwFER7Z9lCJCS/0Kp0SqN1EAWtg2iNoZSTcJFYf7bYN7Nv03PN997W9t7jOnbvtGVxiQu7ec4pHpJS6nuHnCnhBpBLBDgYsmELrPJvGLIoWxTcgvrCh6BSP8Bz8eRCbU9/@AA "Jelly – TIO Nexus")
Traverses all contiguous sublists, filters to keep only those of length 3 and sums (which vectorises) then repeats for each resulting list, to get the sums of all 3 by 3 sub-matrices and finally flattens those into one list, takes the minimum and divides by 9 (the number of elements making this minimal sum).
[Answer]
# Pyth, 19 bytes
```
chSsMsMs.:R3C.:R3Q9
```
A program that takes input of a list of lists and prints the result.
[Test suite](http://pyth.herokuapp.com/?code=chSsMsMs.%3AR3C.%3AR3Q9&test_suite=1&test_suite_input=%5B%5B35%2C+1%2C+6%2C+26%2C+19%2C+24%5D%2C+%5B3%2C+32%2C+7%2C+21%2C+23%2C+25%5D%2C+%5B31%2C+9%2C+2%2C+22%2C+27%2C+20%5D%2C+%5B8%2C+28%2C+33%2C+17%2C+10%2C+15%5D%2C+%5B30%2C+5%2C+34%2C+12%2C+14%2C+16%5D%2C+%5B4%2C+36%2C+29%2C+13%2C+18%2C+11%5D%5D%0A%5B%5B100%2C+65%2C+2%2C+93%5D%2C+%5B3%2C+11%2C+31%2C+89%5D%2C+%5B93%2C+15%2C+95%2C+65%5D%2C+%5B77%2C+96%2C+72%2C+34%5D%5D%0A%5B%5B1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%5D%2C+%5B1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%5D%2C+%5B1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%5D%2C+%5B1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%5D%5D%0A%5B%5B4%2C+0%2C+0%2C+5%2C+4%5D%2C+%5B4%2C+5%2C+8%2C+4%2C+1%5D%2C+%5B1%2C+4%2C+9%2C+3%2C+1%5D%2C+%5B0%2C+0%2C+1%2C+3%2C+9%5D%2C+%5B0%2C+3%2C+2%2C+4%2C+8%5D%2C+%5B4%2C+9%2C+5%2C+9%2C+6%5D%2C+%5B1%2C+8%2C+7%2C+2%2C+7%5D%2C+%5B2%2C+1%2C+3%2C+7%2C+9%5D%5D&debug=0)
**How it works**
*[Explanation coming later]*
[Answer]
# [Haskell](https://www.haskell.org/), 87 bytes
```
import Data.List
t(a:b:c:d)=a+b+c:t(b:c:d);t _=[]
s=(/9).minimum.(t=<<).transpose.map t
```
[Try it online!](https://tio.run/nexus/haskell#JckxDoMgFADQ3VM4dMD4Q0WqFipbx96AkOarHRhAIr/ntyQdX97pQ9oPqp9IyF8@U0UM9aJXvTUG26VdNbE/H1S/jXVVNuyqGh589OEbOCMzzw2nA2NOe/7wgKmmM6CPJh0@0iVbK7oOxgF6UNKBlSAESAF3VaCKBlBD@aJpAjXC1IO8OXf@AA "Haskell – TIO Nexus")
[Answer]
# [Uiua](https://uiua.org), 14 [bytes](https://codegolf.stackexchange.com/a/265917/97916)
```
÷9/↧♭⍥(/+⍉◫3)2
```
[Try it!](https://uiua.org/pad?src=0_3_0__ZiDihpAgw7c5L-KGp-KZreKNpSgvK-KNieKXqzMpMgoKZltbMzUgMSA2IDI2IDE5IDI0XQogIFszIDMyIDcgMjEgMjMgMjVdCiAgWzMxIDkgMiAyMiAyNyAyMF0KICBbOCAyOCAzMyAxNyAxMCAxNV0KICBbMzAgNSAzNCAxMiAxNCAxNl0KICBbNCAzNiAyOSAxMyAxOCAxMV1dCgpmW1sxMDAgNjUgMiA5M10KICBbMyAxMSAzMSA4OV0KICBbOTMgMTUgOTUgNjVdCiAgWzc3IDk2IDcyIDM0XV0KCmZbWzEgMSAxIDEgMSAxIDEgMV0KICBbMSAxIDEgMSAxIDEgMSAxXQogIFsxIDEgMSAxIDEgMSAxIDFdCiAgWzEgMSAxIDEgMSAxIDEgMV1dCgpmW1s0IDAgMCA1IDRdCiAgWzQgNSA4IDQgMV0KICBbMSA0IDkgMyAxXQogIFswIDAgMSAzIDldCiAgWzAgMyAyIDQgOF0KICBbNCA5IDUgOSA2XQogIFsxIDggNyAyIDddCiAgWzIgMSAzIDcgOV1dCg==)
```
÷9/↧♭⍥(/+⍉◫3)2    input: a matrix of shape RxC
      ⍥(      )2    repeat twice:
             ◫3      windows of 3; shape (R-2)x3xC
           ⍉        transpose (rotate axes once); shape 3xCx(R-2)
         /+          sum over the length-3 axis; shape Cx(R-2)
             ◫3      windows of 3; shape (C-2)x3x(R-2)
           ⍉        transpose (rotate axes once); shape 3x(R-2)x(C-2)
         /+          sum over the length-3 axis; shape (R-2)x(C-2)
÷9/↧♭               minimum of all elements divided by 9
```
# [Uiua](https://uiua.org), 14 [bytes](https://codegolf.stackexchange.com/a/265917/97916)
```
÷9/↧♭/+/+◫-2△.
```
[Try it!](https://uiua.org/pad?src=0_3_0__ZiDihpAgw7c5L-KGp-KZrS8rLyvil6stMuKWsy4KCmZbWzM1IDEgNiAyNiAxOSAyNF0KICBbMyAzMiA3IDIxIDIzIDI1XQogIFszMSA5IDIgMjIgMjcgMjBdCiAgWzggMjggMzMgMTcgMTAgMTVdCiAgWzMwIDUgMzQgMTIgMTQgMTZdCiAgWzQgMzYgMjkgMTMgMTggMTFdXQoKZltbMTAwIDY1IDIgOTNdCiAgWzMgMTEgMzEgODldCiAgWzkzIDE1IDk1IDY1XQogIFs3NyA5NiA3MiAzNF1dCgpmW1sxIDEgMSAxIDEgMSAxIDFdCiAgWzEgMSAxIDEgMSAxIDEgMV0KICBbMSAxIDEgMSAxIDEgMSAxXQogIFsxIDEgMSAxIDEgMSAxIDFdXQoKZltbNCAwIDAgNSA0XQogIFs0IDUgOCA0IDFdCiAgWzEgNCA5IDMgMV0KICBbMCAwIDEgMyA5XQogIFswIDMgMiA0IDhdCiAgWzQgOSA1IDkgNl0KICBbMSA4IDcgMiA3XQogIFsyIDEgMyA3IDldXQo=)
```
÷9/↧♭/+/+◫-2△.    input: a matrix of shape RxC
           -2△     subtract 2 from the shape; [R-2, C-2]
          ◫   .    2D windows of that size; gives 3x3x(R-2)x(C-2) array
      /+/+          sum over the first two axes
÷9/↧♭              minimum of all elements divided by 9
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~111~~ 103 bytes
```
lambda m,r=range:min(sum(sum(m[y+i][x:x+3])for i in r(3))/9for x in r(len(m[0])-3)for y in r(len(m)-3))
```
[Try it online!](https://tio.run/nexus/python3#nVBdS8QwEHz3V/Sx4UbMZpM2ObhfUvpQ8SqFa5Wq0Pv1dRIFPR8lH@zMTmazu4@nyzA/Pg3VjPW0Dsvz@ThPS/32MZczd9fD1HfbcTtob8aXtZqqaanWWo15SBlvX/hyXii2vbnXIrv@ojNn9td1Wt7rse46DRA0cA0kwfkenUIdWjiBU7iQGQFzcNzkLZkIF6EKaSEWUkQWAeohDsK7IeWhdE4QCiNE@t6Yu5/SYi2aQOOkpawIWCkmgkQUkALzRG2L1KB1tP9rgZtF7X@YW08Pi9yLLx0ERPjvV55j0BJnBX@LVGKOiblY9IkvEpqij3mMaBm7omYbudb@CQ "Python 3 – TIO Nexus")
[Answer]
# Python 2, 96 bytes
```
h=lambda a:[map(sum,zip(*s))for s in zip(a,a[1:],a[2:])]
lambda a:min(map(min,h(zip(*h(a)))))/9.
```
Test cases at **[Repl.it](https://repl.it/F7Oc)**
An unnamed function taking a list of lists, `a` - the rows of the matrix.
The helper function `h` zips through three adjacent slices, and maps the sum function across the transpose, `zip(*s)`, of each. This results in summing all height three slices of single columns.
The unnamed function calls the helper function, transposes and calls the helper function again on the result, then finds the minimum of each and the minimum of the result, which it then divides by `9.` to yield the average.
[Answer]
## JavaScript (ES6), ~~107~~ ~~98~~ 96 bytes
A function that computes the sums of triplets over the rows and then calls itself to do the same thing over the columns, keeping track of the minimum value `M`.
```
f=m=>m.map((r,y)=>r.map((v,x)=>M=(z[x<<9|y]=v+=r[x+1]+r[x+2])<M?v:M),z=[M=1/0])&&m[1]?f([z]):M/9
```
JS is a bit verbose for that kind of stuff and lacks a native `zip()` method. It took me quite a lot of time to save just a dozen bytes over a more naive approach. (Yet, a shorter method probably exists.)
### Non-recursive version, 103 bytes
*Saved 2 bytes with the help of Neil*
```
m=>m.map((r,y)=>y>1?r.map((v,x)=>[..."12345678"].map(i=>v+=m[y-i%3][x+i/3|0])&&(M=v<M?v:M)):M=1/0)&&M/9
```
### Test cases
```
f=m=>m.map((r,y)=>r.map((v,x)=>M=(z[x<<9|y]=v+=r[x+1]+r[x+2])<M?v:M),z=[M=1/0])&&m[1]?f([z]):M/9
console.log(f([
  [ 35,  1,  6, 26, 19, 24 ],
  [  3, 32,  7, 21, 23, 25 ],
  [ 31,  9,  2, 22, 27, 20 ],
  [  8, 28, 33, 17, 10, 15 ],
  [ 30,  5, 34, 12, 14, 16 ],
  [  4, 36, 29, 13, 18, 11 ]
]));
console.log(f([
  [ 100, 65,  2, 93 ],
  [   3, 11, 31, 89 ],
  [  93, 15, 95, 65 ],
  [  77, 96, 72, 34 ]
]));
console.log(f([
  [ 1, 1, 1, 1, 1, 1, 1, 1 ],
  [ 1, 1, 1, 1, 1, 1, 1, 1 ],
  [ 1, 1, 1, 1, 1, 1, 1, 1 ],
  [ 1, 1, 1, 1, 1, 1, 1, 1 ]
]));
console.log(f([
  [ 4, 0, 0, 5, 4 ],
  [ 4, 5, 8, 4, 1 ],
  [ 1, 4, 9, 3, 1 ],
  [ 0, 0, 1, 3, 9 ],
  [ 0, 3, 2, 4, 8 ],
  [ 4, 9, 5, 9, 6 ],
  [ 1, 8, 7, 2, 7 ],
  [ 2, 1, 3, 7, 9 ]
]));
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~21~~ 16 bytes
```
2FvyŒ3ùO})ø}˜9/W
```
[Try it online!](https://tio.run/nexus/05ab1e#HYyxDQIxEATrQRoJ397bbzdASkhguQ0kgm@CmEIgfhFRlDmQVhvMrHbqdL29776/ztthf26fRzte5uzdM0ZBBWtoGXTHxYoMOco/YoRDkeApSEUVd2zFEvYfJTK@YMKiS6AFj@eGxbCGGOML "05AB1E – TIO Nexus")
**Explanation**
```
2F         }       # 2 times do:
  v     }          # for each row in the matrix
   yŒ3ù            # get all sublists of size 3
       O           # reduce by addition
         )ø        # transpose matrix
            ˜      # flatten the matrix to a list
             9/    # divide each by 9
               W   # get the minimum
```
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata), 10 bytes
```
2ᵑ{q3Lµ}aṁ
```
[Attempt This Online!](https://ato.pxeger.com/run?1=nVA7TkMxEBQtx0g9kby7_t6BNpXl4oGgQQGhJBWi4AipaVIAoqNKQcsx6HITxk4aWmTL2p0Zj8f78nF3fXu_nNbTe53Nl7O2e9usb-b5Uw_77eODXXzvn6bD1_Pr6vJqdeJ2P2eLWi1AEKERUqC-oRpMkaACNWjoiIAclJu4I5KhGWaQBHGQIXIIMA9RCM9IyMPoXCAUZoi0dl6rOIcYaFdsPCYC-ufCprALKIE8u5RQIpLS9HgRfxYV_0G6k4dDT-tHxoAMf9J6ftRG3RVMhjJqDoJcHvrCGwVx6HMfFBJrHWpGbu043l8)
```
2ᵑ{q3Lµ}aṁ
2ᵑ{    }        Apply the following function twice
   q                Choose a contiguous subsequence
    3L              of length 3
      µ             Take its mean
        aṁ      Minimum of all possible results
```
[Answer]
# [Uiua](https://uiua.org), ~~17~~ 16 [bytes](https://codegolf.stackexchange.com/a/265917/97916)
```
÷9/↧♭≡≡(/+♭)◫3_3
```
[Try it!](https://uiua.org/pad?src=0_2_0__ZiDihpAgw7c5L-KGp-KZreKJoeKJoSgvK-KZrSnil6szXzMKCmZbWzM1IDEgNiAyNiAxOSAyNF0KICBbMyAzMiA3IDIxIDIzIDI1XQogIFszMSA5IDIgMjIgMjcgMjBdCiAgWzggMjggMzMgMTcgMTAgMTVdCiAgWzMwIDUgMzQgMTIgMTQgMTZdCiAgWzQgMzYgMjkgMTMgMTggMTFdXQoKZltbMTAwIDY1IDIgOTNdCiAgWzMgMTEgMzEgODldCiAgWzkzIDE1IDk1IDY1XQogIFs3NyA5NiA3MiAzNF1dCgpmW1sxIDEgMSAxIDEgMSAxIDFdCiAgWzEgMSAxIDEgMSAxIDEgMV0KICBbMSAxIDEgMSAxIDEgMSAxXQogIFsxIDEgMSAxIDEgMSAxIDFdXQoKZltbNCAwIDAgNSA0XQogIFs0IDUgOCA0IDFdCiAgWzEgNCA5IDMgMV0KICBbMCAwIDEgMyA5XQogIFswIDMgMiA0IDhdCiAgWzQgOSA1IDkgNl0KICBbMSA4IDcgMiA3XQogIFsyIDEgMyA3IDldXQo=)
-1 thanks to alephalpha
```
÷9/↧♭≡≡(/+♭)◫3_3
            ◫3_3  # 3x3 windows
     ≡≡(   )      # map function to each matrix in 4D array
          ♭       # deshape
        /+        # sum
    ♭             # deshape
  /↧              # minimum
÷9                # divide by 9
```
[Answer]
# [R](https://www.r-project.org/), 78 bytes
```
\(m,l=nrow(m))min(mapply(\(x,y)mean(m[x-0:2,y-0:2]),3:l,y=rep(3:ncol(m),l-2)))
```
[Try it online!](https://tio.run/##ZY/RioQwDEXf/Yo@tnCFJrXVuuuXLPsg7giCVRGH1a9348swO1NCIDnJze16Tp95ard12HWnyVoED0Z0cCCCI1Txqsgj@ouVJWJAyXCFQYHCZOkh8NNurWpUpp5ep50HIYADKIKLf1QpueMYJZjADuzfMEG2wBIyZF9xBa7gxF8JsuLybd3Ci1UQgySHV17AibUIEolKfmzwNBEQlMn65uzvU7cN86QTxmZa51@djEmD1O2yjId@8B2HSbdWwNee25pxXPnbwNUjjma9LdrVUzePIoAxZ2PM2evJfPTSOP8A "R – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 10 bytes
```
2(3lvṁ∩)fg
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2&c=1#WyIiLCIiLCIyKDNsduG5geKIqSlmZyIsIiIsIltbMzUsIDEsIDYsIDI2LCAxOSwgMjRdLCBbMywgMzIsIDcsIDIxLCAyMywgMjVdLCBbMzEsIDksIDIsIDIyLCAyNywgMjBdLCBbOCwgMjgsIDMzLCAxNywgMTAsIDE1XSwgWzMwLCA1LCAzNCwgMTIsIDE0LCAxNl0sIFs0LCAzNiwgMjksIDEzLCAxOCwgMTFdXSJd)
```
2(     )   # Twice
  3l       # Take sliding windows of length 3
    vṁ     # Take the mean of each window
      ∩    # Transpose
        fg # Flatten and take the minimum
```
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), ~~21~~ ~~20~~ 17 bytes
Port of @miles' J solution
-3 thanks to @Bubbler
```
1%9%&//2(+3+/':)/
```
[Try it online!](https://ngn.codeberg.page/k#eJwdj0uOQzEIBPc+RUmjzCTK4hnwjxwo9z/CNE+2bLCLbvh+7JGP3+vy5zve19/ndbX2fcYEg4UvLPHRgCAcNm544FNvISjBcW399OIOfojANtaxm+swiYE5pnMVNwgZJCb0YPaSsfXOmqWYUYxMzcrmZKWpdJJTTKV7k4vtUlaxBM+PSWTQtSbV9dB9dFqriYa6jTsuQsLkHWucqr75VEWybv7UuOxWDRUtv1f7B71yMd8=)
[Answer]
# [Scala](http://www.scala-lang.org/), 142 bytes
Golfed version. [Try it online!](https://tio.run/##PY9Nb4MwDIbv/AofEyliUNYy0ECatMuk5TRtl4qD24UqKAREwrSP9rczA@sixYqf2H5fuyManLpDo44eJGoLP0HwgQbqnD1r5/dLeLK@qorysRsPRnEoJlmUumYydPpb3Sfns2QR/0v4WhVK/HxDMypQximYxzAWge9gw8PaoJfYM12U/6ylvClKyTRnDec0bmxvsjASs45Hbfj6GtC6vnNqZdSn7QTwrmpoyT7D4eRyeBgG/Nq/@EHbU8VzeLXaQ0G7AZ15PUnZ4mkJcRQJ2G0FbARkCRfrVyIgjgUkdO@yK8xmSpXZdu640jQlshOQ0oDklvNFpyd1bywj2wu5BJfpFw)
```
M=>if(M.size<3||M(0).size<3)Double.MaxValue else List((0 to 2).flatMap(i=>(0 to 2).map(j=>M(i)(j))).sum/9.0,f(M.tail),f(M.transpose.tail)).min
```
Ungolfed version. [Try it online!](https://tio.run/##VZBBbwIhEIXv@yvmCAmha7dq19QmTXppUk6mvRgPo7KKYdEsbGNT/e3bga7GkkDgg/ceM36FFrtuv9zpVQCFxsFPlgGsdQUVUxN4Nz7M0/LmwmLBJ/C6b5dWw5QeAg1TAVPSarcJW3iCAk4nUHKrcX0Dea@SCo@faFudpNp63bsAfKGF2rhZu1QYGnOkAJZD64KxpJeVxaDwwAxMn/9d1AR3ESpmONtxzqVva7iDUua9dfw@u/UWsTYZ0Fjebxt0/rD3@g@Sq3FJfM7i7BtSU3sYNhs/gZemwe/5jMzcJjblw5lwbUksRdEp5aZlkOcCRkMB9wLKgkITLQQMBgIKmo/lBZaR0styGBUXOh4TGQkYk0HxwHnKOVB6sI5RBYmcs3PX/QI)
```
object Main {
  def f(M: List[List[Int]]): Double = {
    if (M.length < 3 || M.head.length < 3) Double.MaxValue
    else {
      val minSubMatrix = (0 until 3).flatMap(i => (0 until 3).map(j => M(i)(j))).sum / 9.0
      List(minSubMatrix, f(M.tail), f(M.transpose.tail)).min
    }
  }
  def main(args: Array[String]): Unit = {
    val M = List(List(100, 65, 2, 93), List(3, 11, 31, 89), List(93, 15, 95, 65), List(77, 96, 72, 34))
    println(f(M))
  }
}
```
]