5.0

5.0 | 6 ratings Rate this file 23 Downloads (last 30 days) File Size: 52.2 KB File ID: #39735
image thumbnail

Functional Programming Constructs

by Tucker McClure

 

08 Jan 2013 (Updated 04 Feb 2013)

A set of files for treating many operations, like "if", "for", and even "()", as functions.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

This set of files enables working more easily with functions of functions for concise and powerful code.

A few highlights of this way of working:

* Map multiple inputs to multiple functions and assign multiple outputs with a single line.

* Use conditionals (like "if"), loops, and recursion in anonymous functions.

A document with derivations and examples of these functions is included. See the readme.txt. Also, each function contains a 'help' entry with examples.

This submission requires strong familiarity with function handles and anonymous functions. If those aren't familiar terms, check the documentation first!

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Other requirements Strong familiarity with function handles and anonymous functions
Tags for This File  
Everyone's Tags
anonymous conditional, anonymous function, anonymous loop, function handle, functional programming
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
07 Apr 2013 na ren

it's helpful!

13 Mar 2013 Tucker McClure

Hey, thanks for all the good feedback everyone. I appreciate your taking the time to leave a rating!

13 Mar 2013 Felipe G. Nievinski  
06 Mar 2013 YONGSUNG

good

13 Feb 2013 Eric Sampson

Great work Tucker! :)

31 Jan 2013 Ian

This is an excellent introduction to functional programming in Matlab, thanks Tucker!!!

10 Jan 2013 Matthew  
Updates
04 Feb 2013

Fixed iif to accept function handles for conditions.

Contact us