Mathematica 9 is now available

Length

Usage

Length[expr] 给出expr中元素的个数。


Notes

• 参见 Mathematica 全书: 1.4.8, 节 1.8.3 and 节 2.1.5. • 只要 AtomQ[expr]True, Length[expr] 返回 0
• 同时参见: LeafCount, ByteCount, Depth.
Further Examples

This list has four elements.

In[1]:=  

Out[1]=

This expression has length two.

In[2]:=  

Out[2]=

In[3]:=  

Out[3]//FullForm=

This gives the number of digits in 1000!.

In[4]:=  

Out[4]=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.