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) |
| 29 May 2007 |
Alan Lai
|
|
|
| 17 Sep 2006 |
sathish kumar
|
|
|
| 05 May 2006 |
Andre Sant'Anna
|
|
|
| Updates |
| 03 Jun 2009 |
Insert correct copyright. |
|
Contact us