View License

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

» Watch video

Highlights from
Structure display

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

3.8 | 13 ratings Rate this file 45 Downloads (last 30 days) File Size: 1.82 KB File ID: #13831 Version: 1.1
image thumbnail

Structure display


Thomas Deneux (view profile)


01 Feb 2007 (Updated )

simple recursive display of a structure content in Matlab

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

This function is very simple and recursively displays the fields and sub-fields of a Matlab structure using the built-in 'disp' function.


This file inspired Export Fig(Figname).

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
17 Oct 2016 Seiki SAKAKI  
13 Jul 2015 Demetrio Rodriguez Tereshkin

This is awesome!

How can I submit an improvement? (I mean, I improved your code a little and would like to share)

Comment only
13 Jul 2015 Demetrio Rodriguez Tereshkin

This is awesome!

How can I submit an improvement?

15 Feb 2014 John Yang

This is what I want! good job.

20 Jan 2014 Felipe G. Nievinski

a mnemonic after matlab's builtin celldisp:

function varargout = structdisp (varargin)
[varargout{1:nargout}] = fn_structdisp (varargin{:});

28 Jan 2013 Daniel Golden

Does just what I wanted

05 Jun 2012 Thomas Deneux

Thomas Deneux (view profile)

Comments from B. Roossien and Jeff have been adressed in the June 2012 version.

Comment only
06 Apr 2012 Francesco Montorsi

very nice for me!! thanks!

06 Nov 2011 marc

marc (view profile)

Useful for me

10 Jun 2011 Jeff

Jeff (view profile)

Love the concept... A couple of notes:

1) I'd recommend creating an else condition to the 'if' that starts on line 49. I'm running into a case where nsub is never initialized if you set CELLRECURSIVE to false and has an error.

2) I'd recommend changing on line 90 size(a,1)>1 to (size(a,1)>1 || size(a,2)>1) so that it can display row vectors as well although they do display a little messy.

09 Jan 2011 Simon

Simon (view profile)

simple and neat

30 Oct 2009 Thomas Vanaret

Looks good

Display could be a little improved and some diplayed line could be omitted (nested nested nested nested structures....) but all fields are displayed and one can quickly know where is the field

22 Jun 2009 Markus Buehren

Markus Buehren (view profile)

07 May 2009 Jeff H

Jeff H (view profile)

Quick and effective display of structs

04 Feb 2007 B. Roossien

No H1-line, no help, no comments, no array support. Too simple

08 Feb 2007

change summary

20 Sep 2007

added help and array/cell display

05 Jun 2012 1.1

bux fixes

Contact us