PRODUCTS
Products Overview
Mathematica
Mathematica Student Edition
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Mathematica
Documentation
Knowledge Base
Learning Center
Technical Services
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News
Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE
DOCUMENTATION CENTER
FOR THE LATEST INFORMATION.
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
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
>
BUILT-IN MATHEMATICA SYMBOL
CrossMatrix
DiskMatrix
GaussianMatrix
BoxMatrix
SparseArray
ManhattanDistance
CornerNeighbors
ListConvolve
ImageConvolve
See Also »
|
Constructing Matrices
Image Filtering & Neighborhood Processing
Linear and Nonlinear Filters
Structure Matrices & Convolution Kernels
Summary of New Features in 7.0
New in 7.0: Alphabetical Listing
New in 7.0: Lists and Matrices
New in 7.0: Mathematics & Algorithms
More About »
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
direction.
MORE INFORMATION
The diamond of
s is always at the center of the region.
In
DiamondMatrix
[
r
]
or
DiamondMatrix
the matrix or array is sized so as to just include all nonzero elements.
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
gives a
array.
DiamondMatrix
gives a
array.
DiamondMatrix
[
All
, {
w
1
,
...
,
w
n
}]
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
.
For integer
r
,
DiamondMatrix
[
r
]
yields a
×
matrix.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
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]:=
Out[1]=
Scope
(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:
SEE ALSO
CrossMatrix
DiskMatrix
GaussianMatrix
BoxMatrix
SparseArray
ManhattanDistance
CornerNeighbors
ListConvolve
ImageConvolve
MORE ABOUT
Constructing Matrices
Image Filtering & Neighborhood Processing
Linear and Nonlinear Filters
Structure Matrices & Convolution Kernels
Summary of New Features in 7.0
New in 7.0: Alphabetical Listing
New in 7.0: Lists and Matrices
New in 7.0: Mathematics & Algorithms
New in 7