Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Sample evenly spaced elements from a list
ResourceFunction["Equisample"][list] chooses equally spaced elements from list. | |
ResourceFunction["Equisample"][list,n] chooses n equally spaced elements. | |
ResourceFunction["Equisample"][list,Scaled[m/n]] chooses m out of every n equally spaced elements. |
Sample 10 evenly spaced elements from a range:
In[1]:= |
Out[1]= |
In[2]:= |
Out[2]= |
Sample one of every five elements:
In[3]:= |
Out[3]= |
Take default numbers of equi-spaced samples:
In[4]:= |
Out[4]= |
When the requested samples cannot be exactly equally-spaced, Equisample returns (similar to FindDivisions) a "nice" approximation:
In[5]:= |
Out[5]= |
This work is licensed under a Creative Commons Attribution 4.0 International License