No BSD License  

Highlights from
Structure outline

4.77778

4.8 | 10 ratings Rate this file 10 Downloads (last 30 days) File Size: 18.89 KB File ID: #13500

Structure outline

by B.

 

28 Dec 2006 (Updated 09 Mar 2008)

Prints the hierarchy outline of a structure with optionally, field values.

| Watch this File

File Information
Description

This function prints the hierarchical outline of a structure to the command window or a file. Optionally, field values can be printed as well.

type "help strucdisp" for more information about this function.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Display_structure

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
08 Jan 2007 John D'Errico

I do like this utility, but there is a significant bug. The help states that all arguments but the first are optional. I tried passing in the third argument, but not the second, supplying an empty argument to the second as a placeholder. This should be acceptable. Its also the standard way that Matlab tools use to allow some arguments to be defaulted.

strucdisp(s,[])
??? Operands to the || and && operators must be convertible to logical scalar values.

Error in ==> strucdisp>get_fields at 151
            if (depth < 0) || (indent + 1 < depth)

Error in ==> strucdisp at 64
    liststr = get_fields(structure, 0, depth, flag_value, max_length);

Arguments that take on a default value should test for empty values provided using isempty, and if empty, then provide the default.

I'd have rated this a 5 otherwise, and I will happily raise my rating to that level if it is repaired.

09 Jan 2007 John D'Errico

Problem resolved. My new rating is now the correct one.

This will be a useful utility for those of us who sometimes generate complicated structures.

10 May 2007 B. Roossien

This function has been updated. Some bugs were fixed. Its performance is enhanced and new functionalities (printing small matrices and handling structure arrays) have been added.

23 Jan 2008 Holger Krause

I'm using this function to print out nicely formatted log files containing parameters of various types. strucdisp is just the right tool for this job.

There are three smaller issues:

1. It would be nice, to handle logicals separately (output as text 'true' or 'false' at least for single values).

2. The line for numeric vectors is missing a space in front of the opening bracket.

3. In some cases empty fields get duplicated and occur one time as an empty string '' and a second time as an empty double array [ ].

05 Feb 2008 Rahul Y D

thank you very much really helpful function

08 Mar 2008 B. Roossien

I've fixed a number of bugs and added some improvements following feedback from Holger Krause and Juergen Kurzmann. The new file should be available in 2-3 days.

03 Apr 2008 Juergen Kurzmann

This is a really helpful function for getting a concise overview of data structures (struct) as well as for their documentation!

06 Mar 2009 Mais

very useful

28 May 2009 Benjamin  
24 Jun 2009 Joseph

This is really great. Good job.

19 Oct 2010 Matt Brunner

Awesome! Exactly what I was looking for. Thank you.

31 May 2011 Roger Parkyn

Worked for me.

Please login to add a comment or rating.
Updates
09 Jan 2007

Bug fix following the feedback provided by John D'Errico

08 May 2007

added new functionalities and increased perfomance.

09 Mar 2008

Improved functionality and a number of bug-fixes

Tag Activity for this File
Tag Applied By Date/Time
structures B. 22 Oct 2008 08:54:24
cell arrays B. 22 Oct 2008 08:54:24
structure tree outline hierarchy B. 22 Oct 2008 08:54:24

Contact us at files@mathworks.com