Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Image Processing & Analysis > Image Filtering & Neighborhood Processing > Structure Matrices & Convolution Kernels > DiamondMatrix >
Mathematica > Data Manipulation > Signal Processing > Linear and Nonlinear Filters > Structure Matrices & Convolution Kernels > DiamondMatrix >
Mathematica > Mathematics and Algorithms > Matrices and Linear Algebra > Constructing Matrices > Structure Matrices & Convolution Kernels > DiamondMatrix >

DiamondMatrix

DiamondMatrix[r]
gives a matrix whose elements are in a diamond-shaped region that extends r index positions to each side, and are otherwise.
DiamondMatrix
gives a w×w matrix containing a diamond-shaped region of s.
DiamondMatrix
yields an array whose elements are in a diamond-shaped region that extends index positions in the i^(th) direction.
  • The diamond of s is always at the center of the region.
  • The region of s is taken to be the best discrete approximation to a diamond-shaped region possible given the size of the matrix.
  • DiamondMatrix[All, w] gives a w×w matrix containing a diamond shape that is as large as possible.
  • DiamondMatrix[All, {w1, ..., wn}] gives a array containing a diamond-shaped region that is as large as possible.
  • The parameter r need not be an integer; in general elements are if their Manhattan distance from the center is not more than .
This computes and plots a square diamond-shaped matrix of radius 10:
This computes and plots a square diamond-shaped matrix of radius 10:
In[1]:=
Click for copyable input
Out[1]=
Create a rectangular diamond-shaped matrix:
Put a diamond inside a bigger matrix:
Extend the diamond to the boundaries of the matrix:
Automatically choose an odd width to just fit the diamond:
Extend the diamond to the given width, and automatically choose the height:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF