File Exchange

image thumbnail

For-Each

version 1.01 (28.4 KB) by Jeremy Hughes
Tools for simplifying for-loops. Customizable loop iteration.

2.2K Downloads

Updated 25 Apr 2017

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

The for-each tools enable simple, readable, and powerful for loops in MATLAB(R).
For example, you can:
* Loop over the contents of a cell array without using braces for indexing,
* Convert an arbitrarily nested for-loop to a single loop using eachCombination,
* Loop through slices of an N-D array along any dimension(s),
* Loop over large numbers of permutations of a vector,
* Define your own rules for iterating over an array.
(Works from release R2009b)

Cite As

Jeremy Hughes (2021). For-Each (https://www.mathworks.com/matlabcentral/fileexchange/48729-for-each), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: each

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!