About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconForeach for containers.Map (Scripts) Publisher's description

Matlab offers functionality for maps / dictionaries (a key-value store datatype)

Matlab offers functionality for maps / dictionaries (a key-value store datatype). Iterating over a map can be cumbersome and that's where foreach steps in.

resultmap = foreach(map, fctH)
calls function handle fctH with each item of the map. The result is stored in the resultmap which has the same keys as the original map.

If you have two or more datasets, and you want to process/plot them identically one function call is enough.
This turned out to be useful if you write a script processing one dataset. But then you want to compare to another ... either you can duplicate code or you iterate over the items. Foreach simplifies this iteration and keeps a readable key to the dataset ('which dataset has index 3?')

So long it's not much more than iterating over a cell array. However, if you combine foreach with some anonymous functions you get a much more powerful tool: foreach can call the function handle with the current iteration key so that one f.ex. can attach the corresponding legend-entry to a plot, using the corresponding axis ...

Try also 'help foreach' for more information and examples.

I hope you'll find it useful. Feedback is welcome!

System Requirements:

MATLAB 7.10 (2010a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Foreach for containers.Map (Scripts) Tags:

Click on a tag to find related softwares

Is Foreach for containers.Map (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.