4.66667

4.7 | 3 ratings Rate this file 38 downloads (last 30 days) File Size: 2.23 KB File ID: #8525

Nested Functions in MATLAB

by Loren Shure

 

21 Sep 2005 (Updated 03 Jun 2009)

Code covered by BSD License  

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

Download Now | 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)
Zip File Content  
Other Files license.txt,
twoFigs.m
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
nested multiple figures Loren Shure 22 Oct 2008 08:00:25
white paper Loren Shure 22 Oct 2008 08:00:25
whitepapers Loren Shure 22 Oct 2008 08:00:25
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com