PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
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
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training & Free Seminars
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
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Core Language
>
List Manipulation
>
Rearranging & Restructuring Lists
>
Riffle
>
Mathematica
>
Data Manipulation
>
Handling Arrays of Data
>
Rearranging & Restructuring Lists
>
Riffle
>
Mathematica
>
Data Manipulation
>
Image Processing & Analysis
>
Basic Image Manipulation
>
Handling Arrays of Data
>
Rearranging & Restructuring Lists
>
Riffle
>
BUILT-IN MATHEMATICA SYMBOL
Rearranging Lists
Partitioning and Padding Lists
Grouping and Combining Elements of Lists
Tutorials »
|
Insert
Take
PadLeft
See Also »
|
Annotating & Combining Graphics
List Manipulation
Rearranging & Restructuring Lists
New in 6.0: Core Language
New in 6.0: List Manipulation
New in 6.0: Numerical Data Handling
More About »
Riffle
Riffle
gives
.
Riffle
gives
.
Riffle
yields a list in which every
n
element is
x
.
Riffle
yields a list in which
x
appears if possible at positions
,
,
, ... ,
.
MORE INFORMATION
If there are fewer
than gaps between
in
Riffle
, the
are used cyclically.
Riffle
gives
{
e
}
.
The specification
is of the type used in
Take
. Negative indices count from the end of the list.
Riffle
is equivalent to
Riffle
.
Riffle
is equivalent to
Riffle
.
In
Riffle
, if
list
and
xlist
are of the same length, then their elements are directly interleaved, so that the last element of the result is the last element of
xlist
.
Riffle
works with
SparseArray
objects.
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Riffle
between successive elements in a list:
Riffle in
and
cyclically:
Riffle in
at every 3
position:
Riffle
between successive elements in a list:
In[1]:=
Out[1]=
Riffle in
and
cyclically:
In[1]:=
Out[1]=
Riffle in
at every 3
position:
In[1]:=
Out[1]=
Scope
(7)
Riffle in
at every other position:
Include
at the beginning and end:
Use step 3:
Start riffling in
only at position 5:
Cyclically riffle in
and
:
Intersperse two lists:
Riffle
works on
SparseArray
objects:
Applications
(5)
Insert spaces between words:
Create a directory name from a path list:
Insert 0s between successive integers:
Alternate positive and negative integers:
Insert commas at every 4
character:
Properties & Relations
(1)
Riffle
is related to
Transpose
:
SEE ALSO
Insert
Take
PadLeft
TUTORIALS
Rearranging Lists
Partitioning and Padding Lists
Grouping and Combining Elements of Lists
MORE ABOUT
Annotating & Combining Graphics
List Manipulation
Rearranging & Restructuring Lists
New in 6.0: Core Language
New in 6.0: List Manipulation
New in 6.0: Numerical Data Handling
New in 6