Be the first to rate this file! 13 downloads (last 30 days) File Size: 3.21 MB File ID: #18874

Video tutorial: Advanced MATLAB: Dynamic field names in structures

by Doug Hull

 

21 Feb 2008 (Updated 26 Feb 2008)

Code covered by BSD License  

Two minute video shows an excellent way to refer to fields in structure dynamically.

Download Now | Watch this File

File Information
Description

This short video shows which is the best code below:
                    
a.doug = 'Hull'
a.jiro = 'Doke'
name = 'doug';
last = a.doug
eval(['last = a.' name]) % BAD
last = a.(name) % GOOD

See more videos without downloading here:
http://blogs.mathworks.com/pick/category/video

MATLAB release MATLAB 7.5 (R2007b)
Zip File Content  
HTML Files Video from http://blogs.mathworks.com/pick
Other Files
80 Advance dot parens notation.css,
80 Advance dot parens notation.flv,
images/vid_bkgd.gif,
80 Advance dot parens notation.js,
80 Advance dot parens notation_config.xml,
80 Advance dot parens notation_controller.swf,
80 Advance dot parens notation_iPod.m4v,
80 Advance dot parens notation_nofp_bg.gif,
80 Advance dot parens notation_preload.swf,
Additional-embed.js,
ProductionInfo.xml,
swfobject.js,
images/bottom_center.jpg,
images/bottom_center_left.jpg,
images/bottom_left.jpg,
images/top_right_corner.jpg,
images/curain_bkgd.gif,
images/dl_bkgd.gif,
images/dl_icon.gif,
images/dl_icon_bkgd.gif,
images/dl_icon_bkgd_over.gif,
images/dl_row_bkgd.gif,
images/play_bttn_bkgd.gif,
images/play_icon.gif,
images/spacer.gif,
images/top_center.gif,
images/top_center.jpg,
images/top_center_clr.gif,
images/top_left_corner.jpg,
images/bottom_right.jpg
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
26 Feb 2008

files were blank

Tag Activity for this File
Tag Applied By Date/Time
video Doug Hull 22 Oct 2008 09:50:14
tutorial Doug Hull 22 Oct 2008 09:50:14
structure Doug Hull 22 Oct 2008 09:50:14
field Doug Hull 22 Oct 2008 09:50:14
eval Doug Hull 22 Oct 2008 09:50:14
dynamic Doug Hull 22 Oct 2008 09:50:14
 

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