Code covered by the BSD License  

Highlights from
Nested Functions in MATLAB

4.66667

4.7 | 3 ratings Rate this file 15 Downloads (last 30 days) File Size: 2.23 KB File ID: #8525
image thumbnail

Nested Functions in MATLAB

by Loren Shure

 

21 Sep 2005 (Updated 03 Jun 2009)

This example shows how to use nested functions to avoid making copies of large arrays in MATLAB.

| Watch this File

File Information
Description

twoFigs.m is an example M-file to accompany the article "Nested Functions in MATLAB" in the January 2006 issue of The MathWorks News & Notes.

twoFigs.m is an example 2-figure GUI that uses nested functions to manage the data and state. Since the data is an image, it could be large and this example shows you how to use nested functions to avoid unnecessary copies of such data. Try it with this example:

% Substitute mandrill with
% any indexed image here
load mandrill
rgb = ind2rgb(X,map);
twoFigs(rgb)

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
05 May 2006 Andre Sant'Anna

Didn't know you could do this !

17 Sep 2006 sathish kumar

it is very useful tips for studends as well as matlab users

29 May 2007 Alan Lai

Downloaded this after seeing Loren talk about it at the Mathworks World Tour in Melbourne.

Please login to add a comment or rating.
Updates
03 Jun 2009

Insert correct copyright.

Tag Activity for this File
Tag Applied By Date/Time
whitepaper Loren Shure 22 Oct 2008 08:00:25
article Loren Shure 22 Oct 2008 08:00:25
paper Loren Shure 22 Oct 2008 08:00:25
whitepapers Loren Shure 22 Oct 2008 08:00:25
white paper Loren Shure 22 Oct 2008 08:00:25
nested multiple figures Loren Shure 22 Oct 2008 08:00:25
nested multiple figures Olival do Lago 04 Jun 2011 08:44:12

Contact us at files@mathworks.com