View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 1.37 KB File ID: #41301 Version: 1.0



Richard Moore (view profile)


Display the fields of a structure as a tree.

| Watch this File

File Information

Some functions that I use, especially ones that read complicated file types, produce complicated structures with many sub fields. This function displays the structure and all of the sub fields as an ascii tree in the command line terminal.

It does NOT actually show the contents of the fields, just the names of the fields.

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
07 May 2013 Marcel Rüland

This is a nice tool: simple and helpful. For very large structs it becomes slightly unclear. For a better overview I don't show the leave nodes by nesting line 27 with an if statement:
if isstruct(run.(namesout{x}))
ShowStructTree(eval([a(1).name '.' namesout{x}]),[toprint '.' namesout{x}]);
Thank you

17 Apr 2013 Jan Simon

Jan Simon (view profile)

There is no need to use the evil EVAL! "Dynamic fieldnames" work for over 10 years now:

a.b = 15
s = 'b'

Comment only

Contact us