PRODUCTS
Mathematica
Mathematica for Students
Mathematica for the Classroom
grid
Mathematica
web
Mathematica
Mathematica Player
(free download)
Mathematica Player Pro
Wolfram
Workbench
Mathematica
Applications
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
FOR USERS
All User Resources
Product Registration
Technical Support
Customer Service
Developer Support
Does My Site Have a License?
Free Seminars
Certified Training
Custom Group Seminars
Documentation & Examples
Tutorial Screencasts
Video Gallery
Demonstrations Project
Education Portal
Student Resources
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Wolfram Blog
Mathematica Journal
Wolfram Library Archive
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
Mathematica
>
Core Language
>
Expressions
>
Expression Structure
>
Built-in
Mathematica
Symbol
Controlling the Display of Large Expressions
Vectors and Matrices
Manipulating Expressions like Lists
Tutorials »
|
LeafCount
ByteCount
Depth
StringLength
AtomQ
ComplexityFunction
LengthWhile
See Also »
|
Elements of Lists
Expressions
Expression Structure
Handling Arrays of Data
Language Overview
List Manipulation
Math & Counting Operations on Lists
Memory Measurement & Optimization
Operations on Vectors
Parts of Expressions
More About »
Length
Length
[
expr
]
gives the number of elements in
expr
.
MORE INFORMATION
When
expr
is a
SparseArray
object,
Length
[
expr
]
returns the length of the corresponding ordinary list.
»
Otherwise,
Length
[
expr
]
returns
0
whenever
AtomQ
[
expr
]
is
True
.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Find the length of a list:
In[1]:=
Out[1]=
Scope
(2)
Generalizations & Extensions
(4)
Applications
(5)
Properties & Relations
(1)
Possible Issues
(5)
SEE ALSO
LeafCount
ByteCount
Depth
StringLength
AtomQ
ComplexityFunction
LengthWhile
TUTORIALS
Controlling the Display of Large Expressions
Vectors and Matrices
Manipulating Expressions like Lists
MORE ABOUT
Elements of Lists
Expressions
Expression Structure
Handling Arrays of Data
Language Overview
List Manipulation
Math & Counting Operations on Lists
Memory Measurement & Optimization
Operations on Vectors
Parts of Expressions
RELATED LINKS
NKS|Online
(
A New Kind of Science
)
New in 1 | Last modified in 5
© 2008 Wolfram Research, Inc.