BoxMatrix
✖
BoxMatrix
Details

- BoxMatrix[r] gives a square pattern of
s extending r positions from the center.
- The parameter r need not be an integer; elements are
if their chessboard distance from the center is not more than r+1/2.
- BoxMatrix[All,w] gives a w×w matrix containing a box shape that is as large as possible.
- BoxMatrix[…,{w1,w2,…}] gives a w1×w2×… array.
- BoxMatrix[{r1,…,rn},w] gives a w×…×w array.
- BoxMatrix[All,{w1,…,wn}] gives a w1×…×wn array containing a box-shaped region that is as large as possible.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
Put a box inside a bigger matrix:
In[2]:=2

✖
https://wolfram.com/xid/0j47tkte-xjedjo
Out[2]=2

Extend the box to the boundaries of the matrix:
In[1]:=1

✖
https://wolfram.com/xid/0j47tkte-qazkdu
Out[1]=1

Automatically choose a width to just fit the box matrix:
In[1]:=1

✖
https://wolfram.com/xid/0j47tkte-145bbn
Out[1]=1

Extend the box to the given width, and automatically choose the height:
In[1]:=1

✖
https://wolfram.com/xid/0j47tkte-fultpq
Out[1]=1

Neat Examples (1)Surprising or curious use cases
In[1]:=1

✖
https://wolfram.com/xid/0j47tkte-teajz5
Out[1]=1

Wolfram Research (2008), BoxMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/BoxMatrix.html.
✖
Wolfram Research (2008), BoxMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/BoxMatrix.html.
Text
Wolfram Research (2008), BoxMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/BoxMatrix.html.
✖
Wolfram Research (2008), BoxMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/BoxMatrix.html.
CMS
Wolfram Language. 2008. "BoxMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BoxMatrix.html.
✖
Wolfram Language. 2008. "BoxMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BoxMatrix.html.
APA
Wolfram Language. (2008). BoxMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BoxMatrix.html
✖
Wolfram Language. (2008). BoxMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BoxMatrix.html
BibTeX
✖
@misc{reference.wolfram_2025_boxmatrix, author="Wolfram Research", title="{BoxMatrix}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/BoxMatrix.html}", note=[Accessed: 30-May-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_boxmatrix, organization={Wolfram Research}, title={BoxMatrix}, year={2008}, url={https://reference.wolfram.com/language/ref/BoxMatrix.html}, note=[Accessed: 30-May-2025
]}