3 added 41 characters in body

# MATLAB, 3130 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


This is an anonymous function. For the usage, we have to assume a name, e.g. f=@imfill. Then we can just evaluate it as f(input,point), where input is a logical matrix, e.g. [0,0;0,1], and point is a 2d-vector with 1-based coordinates, e.g. [1,2].

Old version working on strings:

@(a,p)[imfill(a~=32a>32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

Thanks @LuisMendo for -1 byte.

# MATLAB, 31 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


This is an anonymous function. For the usage, we have to assume a name, e.g. f=@imfill. Then we can just evaluate it as f(input,point), where input is a logical matrix, e.g. [0,0;0,1], and point is a 2d-vector with 1-based coordinates, e.g. [1,2].

Old version working on strings:

@(a,p)[imfill(a~=32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

# MATLAB, 30 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


This is an anonymous function. For the usage, we have to assume a name, e.g. f=@imfill. Then we can just evaluate it as f(input,point), where input is a logical matrix, e.g. [0,0;0,1], and point is a 2d-vector with 1-based coordinates, e.g. [1,2].

Old version working on strings:

@(a,p)[imfill(a>32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

Thanks @LuisMendo for -1 byte.

2 added 263 characters in body

# MATLAB, 31 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


This is an anonymous function. For the usage, we have to assume a name, e.g. f=@imfill. Then we can just evaluate it as f(input,point), where input is a logical matrix, e.g. [0,0;0,1], and point is a 2d-vector with 1-based coordinates, e.g. [1,2].

Old version working on strings:

@(a,p)[imfill(a~=32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

# MATLAB, 31 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


Old version working on strings:

@(a,p)[imfill(a~=32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

# MATLAB, 31 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


This is an anonymous function. For the usage, we have to assume a name, e.g. f=@imfill. Then we can just evaluate it as f(input,point), where input is a logical matrix, e.g. [0,0;0,1], and point is a 2d-vector with 1-based coordinates, e.g. [1,2].

Old version working on strings:

@(a,p)[imfill(a~=32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).

1

# MATLAB, 31 7 bytes

As we can use logical inputs instead of strings, we can use the bare function, as it is:

@imfill


Old version working on strings:

@(a,p)[imfill(a~=32,p)*3+32,'']


This anonymous function accepts the input as well as a vector with the coordinates (1-based index). The function imfill does exactly what we need, but operates only on binary images. That is why we convert the input matrix to a logical array (where # are the boundaries, and (spaces) are the void), performs the filling and is then converted back. (again # is filled, space is not filled).