Mathematica 9 is now available

Drop

Usage

Drop[list, n]y给出丢掉它前 n 个元素后得到的 list.
Drop[list, -n]y给出丢掉它后 n 个元素后得到的 list.
Drop[list,  n ] 给出丢掉它的n 元素的list.
DrDrop[list,  m, n ] 给出丢掉从 m n 的元素后得到的list.
Drop[list,  m, n, s ] 给出以步长s丢掉从mn 的元素后得到的list.
Drop[list,  ,  , ... ] 给出一个嵌套列表,在该列表中由  指定的 listi 层上的元素已被丢掉.


Notes

Drop 使用标准的序列指定.(参见 A.3.5节.)
• 例如:Drop[ a,b,c,d,e , 2]LongRightArrow .
Drop[ a,b,c,d,e , -3]LongRightArrow .
Drop[Range[7],  2, 5, 2 ]LongRightArrow .
Drop 可以被使用到一个具有任意头的对象上,而不必是List.
Drop[list,  ,  ]能有效地丢掉除那些出现在 list子矩阵中元素外的所有元素.
• 例如:Drop[  a,b,c , d,e,f  , 1, -1]LongRightArrow .
• 参见Mathematica 全书:1.8.4节.
• 同时参见: Rest, StringDrop, Take, Cases.
Further Examples

Here is a list.

In[1]:=  

This drops  , the second element.

In[2]:=  

Out[2]=

This drops  , the third element from the end.

In[3]:=  

Out[3]=

This drops  ,  ,  , the third through fifth elements.

In[4]:=  

Out[4]=

Here is a  x  matrix.

In[5]:=  

In[6]:=  

Out[6]//MatrixForm=

This drops row  .

In[7]:=  

Out[7]//MatrixForm=

This drops column  .

In[8]:=  

Out[8]//MatrixForm=

This drops row  and column  .

In[9]:=  

Out[9]//MatrixForm=

In[10]:=  



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.